Click here to Skip to main content
16,016,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am working on application using Entity Framework 5 in VS-2013, I need to call store procedure from Oracle packages.
I am using ODP.NET (Managed driver) for connection.

My SP is :
SQL
create or replace procedure "GETQUEUES"
    (
       qID number,
       P_RESULTSET OUT SYS_REFCURSOR
    )
is
begin
    OPEN p_cursor FOR
select *
    from QUEUE;
end;​

After doing all the required actions like Add Function Import and get column info.

I get this code in Model.Context.cs:
C#
public virtual ObjectResult<SDK_PACKAGE_GETQUEUES_Result> SDK_PACKAGE_GETQUEUES(Nullable<decimal> qID)
       {
           var qIDParameter = qID.HasValue ?
               new ObjectParameter("QID", qID) :
               new ObjectParameter("QID", typeof(decimal));

           return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<SDK_PACKAGE_GETQUEUES_Result>("SDK_PACKAGE_GETQUEUES", qIDParameter);
       }



My Config :
XML
<oracle.manageddataaccess.client>
    <version number="*">
      <implicitRefCursor>
        <storedProcedure schema="XYZ" name="GETQUEUES">
          <refCursor name="P_RESULTSET">
            <bindInfo mode="Output" />
            <metadata columnOrdinal="0" columnName="QUEUEID" providerType="Decimal" nativeDataType="Number" />
            <metadata columnOrdinal="1" columnName="QUEUENAME" providerType="Varchar2" nativeDataType="Varchar2" />
          </refCursor>
        </storedProcedure>
      </implicitRefCursor>
    </version>
  </oracle.manageddataaccess.client>



Problem is:
When I call and run this code I got this error::
ORA-06550 PLS-00306: wrong number or types of arguments in call to 'GETQUEUES'\nORA-06550

I dnt understand where should I place OUT parameter.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900