Entity Framework Oracle Stored Procedure not Returning Complex Type
904169Dec 9 2011 — edited Dec 28 2011I am new to Oracle and not sure I am understanding what I have done incorrectly.
Here is the use case: I am using an Oracle DB with stored procedures (SPROCs) and then using .Net EntityFramework (EF) to gleam data out of the RDBMS.
Requirement: To work with data one has to use SPROCs for all CRUDs.
Information: The RDBMS model is not the same as the object model. With that said, I was planning on using complex types out of EF to map to the Object model.
Issue: EF is not able to obtain data from the SPROC => "The selected stored procedure returns no columns." Which is incorrect, I am returning a SYS_REFCURSOR as outlined in the tutorial (http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkOBE/EntityFrameworkOBE.htm#t3).
Details:
I have installed ODAC 11.2 Release 3 (11.2.0.2.1) with Oracle Developer Tools for Visual Studio.
I have installed ODAC 11.2.0.2.50 Beta Entity Framework 32 bit.
Have two tables (parent-child relationship) that we are joining in a store procedure (without any "." in the name) which has for a IN an INTEGER and a SYS_REFCURSOR for OUT.
create or replace
PROCEDURE PRC_SELECT_Expct_Exception (pIN_ExpectedExceptionTypeID IN INTEGER
,pOUT_Rec_Result OUT SYS_REFCURSOR
)
IS
BEGIN
OPEN pOUT_Rec_Result FOR
SELECT et.EXPCT_EXCEPTION_TYP_ID
, et.EXPCT_EXCEPTION_NAME
, et.SEVERITY
, DECODE(et.IS_DETAIL_DISPLAYED, NULL, 'False'
, 1, 'True'
, 0, 'False')IS_DETAIL_DISPLAYED
, msg.MESSAGE
FROM COMP.EXPCT_EXCEPTION_TYP et INNER JOIN
COMP.EXPCT_EXCEPTION_TYP_MSG msg ON et.EXPCT_EXCEPTION_TYP_ID = msg.EXPCT_EXCEPTION_TYP_ID
WHERE et.EXPCT_EXCEPTION_TYP_ID = pIN_ExpectedExceptionTypeID;
END;
Basic stuff. I able to obtain data from various SQL IDEs except when I run "Get Column Information" within the "Add Function Import" or "Edit ..." (which is annoying that it is not seen in EF).
We will not be using any Updates, Inserts, or Deletes right now, that is later down the road; meaning there is no mapping happening here between an object and input parameters. Just SELECTS.
What am I missing to configure this to function to return a complex type?
Thank you for your assistance.
Edited by: 901166 on Dec 12, 2011 11:27 AM