This question is locked. New answers and comments are not allowed.
I've been doing a lot of tests to ORM using Oracle (11) and the class mappings work fine, the linq queries obviously also but the stored procedures have a lot of problems (or I haven't yet figured out if I'm doing something wrong)
First, when I use the tool to create the CUD Mappings and I set to use stored procedures, it doesn't list the existing "imported" stored procedures. Ok maybe it has to create it's own, so I set it to create a new stored procedure for the insert for example. The result seams fine but the query it uses to create the SP on the DB is wrong for Oracle (ex: RowsAffected := SQL%ROWCOUNT ; without creating the variable first)
So i tried to create my own insert SP and use it on the application using:
dbContext.ExecuteStoredProcedure<object>("SP_APP_MENU_INS", sqlParameters, "aaa", 10, "bb");
and it returns a null exception (the fields are fine)
even using: dbContext.SPAPPMENUINS("aaa", 12, "bb"); same error
and the SP is:
So I'm not sure if it supports everything or I am doing something wrong.
Another thing, I have a SP that returns a cursor (it's a select from various tables), does ORM support this also? Please see my previous post (Where is 'Enable project to use ORM'?)
First, when I use the tool to create the CUD Mappings and I set to use stored procedures, it doesn't list the existing "imported" stored procedures. Ok maybe it has to create it's own, so I set it to create a new stored procedure for the insert for example. The result seams fine but the query it uses to create the SP on the DB is wrong for Oracle (ex: RowsAffected := SQL%ROWCOUNT ; without creating the variable first)
So i tried to create my own insert SP and use it on the application using:
dbContext.ExecuteStoredProcedure<object>("SP_APP_MENU_INS", sqlParameters, "aaa", 10, "bb");
and it returns a null exception (the fields are fine)
System.NullReferenceException: Object reference not
set
to an instance of an
object
.
at OpenAccessRuntime.Relational.RelationalQueryResult.set_QResult(QueryResultContainer value)
at OpenAccessRuntime.Relational.RelationalQueryResult.prepare(QueryResultContainer qContainer)
at OpenAccessRuntime.Relational.RelationalQueryResult.nextBatch(ApplicationContext context, Int32 skipAmount, QueryResultContainer qContainer)
at OpenAccessRuntime.Relational.RelationalStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
even using: dbContext.SPAPPMENUINS("aaa", 12, "bb"); same error
and the SP is:
CREATE
OR
REPLACE
PROCEDURE
SP_APP_MENU_INS(oMENU_ID
IN
NVARCHAR2,
oCONTEXT_TAG_ID
IN
NVARCHAR2
DEFAULT
NULL
,
oDISPLAY_ORDER
IN
NUMBER
DEFAULT
NULL
)
IS
RowsAffected Number;
BEGIN
INSERT
INTO
APP_MENU
(MENU_ID, CONTEXT_TAG_ID, DISPLAY_ORDER)
VALUES
(oMENU_ID, oCONTEXT_TAG_ID, oDISPLAY_ORDER);
RowsAffected := SQL%ROWCOUNT;
END
;
So I'm not sure if it supports everything or I am doing something wrong.
Another thing, I have a SP that returns a cursor (it's a select from various tables), does ORM support this also? Please see my previous post (Where is 'Enable project to use ORM'?)