Stored Procedure Parameter Mapping
Posted: Mon 24 Jan 2011 14:39
I have a stored procedure such as the following:
PROCEDURE JustTesting(curParam OUT SYS_REFCURSOR) AS
BEGIN
OPEN curParam FOR
SELECT *
FROM MyTable;
END JustTesting;
I have followed the instructions as outlined here: http://www.devart.com/dotconnect/oracle ... rsors.html
I have used the ADO.NET POCO Entity Generator to provide the model and context templates and generated the relevant classes.
The context now contains the following method relating to my function:
public ObjectResult JustTesting()
{
return base.ExecuteFunction("JustTesting");
}
Calling this method raises an error such as: "The data reader is incompatible with the specified MyModel.JustTestingResult'. A member of the type, 'MyTestId', does not have a corresponding column in the data reader with the same name."
Now, the reason for this is that the column in the database is named "My_Test_Id" not MyTestId. So, I can rename this in the JustTestingResult complex type (and this will work), but then why should my conceptual model have to be tightly coupled with the physical model? So, the question is, how do I map between MyTestId and My_Test_Id?
Thanks
PROCEDURE JustTesting(curParam OUT SYS_REFCURSOR) AS
BEGIN
OPEN curParam FOR
SELECT *
FROM MyTable;
END JustTesting;
I have followed the instructions as outlined here: http://www.devart.com/dotconnect/oracle ... rsors.html
I have used the ADO.NET POCO Entity Generator to provide the model and context templates and generated the relevant classes.
The context now contains the following method relating to my function:
public ObjectResult JustTesting()
{
return base.ExecuteFunction("JustTesting");
}
Calling this method raises an error such as: "The data reader is incompatible with the specified MyModel.JustTestingResult'. A member of the type, 'MyTestId', does not have a corresponding column in the data reader with the same name."
Now, the reason for this is that the column in the database is named "My_Test_Id" not MyTestId. So, I can rename this in the JustTestingResult complex type (and this will work), but then why should my conceptual model have to be tightly coupled with the physical model? So, the question is, how do I map between MyTestId and My_Test_Id?
Thanks