diy / opensourcerer.diy.org

A DIY Guide to Git, GitHub and open source collaboration!
opensourcerer.diy.org
Other
14 stars 14 forks source link

Importing function with multiple ref cursors in Stored Procedure of Oracle 12c database Using EF6 #16

Open Dharma1986 opened 9 years ago

Dharma1986 commented 9 years ago

Hi Good day!

I can able to import function for stored procedure of oracle db and able to add the complex type and get the output but i tried to import the procedure which having two ref cursors and unable to retrieve the column information. Only able to retrieve the columns of first ref cursor. Please help me to get the result of two ref cursors which acting as out parameters.

below is the my oracle db sp

procedure ibp_countrystate_getlist
          (       
           p_country_id   in     number,           
           p_cntry_getlist out   SYS_REFCURSOR,
           p_state_getlist out   SYS_REFCURSOR
           )as
 begin
      open   p_cntry_getlist  for      
        select country_pid,country_code,country_name,country_fname
        from     ibt_country_master
        where     country_pid=p_country_id
        and       country_status in ('A','D');

     open p_state_getlist for    
        select state_pid,state_code,state_name,state_country_id
        from  ibt_state_master
        where state_country_id=p_country_id
        and state_status in('A','D');
 end;

and my web.config for refursor configuration is below..

<storedProcedure schema="C##TEST" name="IBP_COUNTRYSTATE_GETLIST">
          <refCursor name="P_CNTRY_GETLIST">
            <bindInfo mode="Output" />
            <metadata columnOrdinal="0" columnName="COUNTRY_PID" providerType="Decimal" allowDBNull="false" nativeDataType="Number" />
            <metadata columnOrdinal="1" columnName="COUNTRY_CODE" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2" />
            <metadata columnOrdinal="2" columnName="COUNTRY_NAME" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2" />
            <metadata columnOrdinal="3" columnName="COUNTRY_FNAME" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2" />
          </refCursor>
          <refCursor name="P_STATE_GETLIST">
            <bindInfo mode="Output" />
            <metadata columnOrdinal="0" columnName="STATE_PID" providerType="Decimal" allowDBNull="false" nativeDataType="Number" />
            <metadata columnOrdinal="1" columnName="STATE_CODE" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2" />
            <metadata columnOrdinal="2" columnName="STATE_NAME" providerType="Varchar2" allowDBNull="true" nativeDataType="Varchar2" />
            <metadata columnOrdinal="3" columnName="STATE_COUNTRY_ID" providerType="Decimal" allowDBNull="false" nativeDataType="Number" />
          </refCursor>
        </storedProcedure>
krptodr commented 6 years ago

What about returning a refcursor and a normal variable like a long?

procedure ibp_countrystate_getlist
          (       
           p_country_id   in     number,           
           SOME_ID     OUT LONG,
           p_cntry_getlist out   SYS_REFCURSOR,
           p_state_getlist out   SYS_REFCURSOR
           )