none
Call Ref cursors from Data access Application Blocks RRS feed

  • Question

  • Hi,

         I am using the Enterprise Library 2007 and my back end is Oracle. My Oracle Procedure is returning Ref cursor like the below

    PROCEDURE Select_T_District(IDistrict_ID char,District_Cursor OUT Sys_RefCursor)
     IS
        BEGIN
              OPEN District_Cursor
              FOR
              SELECT *
              FROM T_District WHERE District_ID=IDistrict_ID;

    Now in C#.NET I am calling the procedure by using Data access application Block (DAAB)

    Database db = DatabaseFactory.CreateDatabase("DBConnection");

    // DbCommand cmd = db.GetSqlStringCommand("Select * from SOF.T_District");

    DbCommand cmd = db.GetStoredProcCommand("Select_TDistrict");

    db.AddOutParameter(cmd,dbType. )

    dbType doesnot have the Cursor type.

    How to call Ref cursor from DAAB.

    Thanks in advance.

    Tuesday, June 5, 2007 6:18 PM

All replies

  • I am not sure what kind of .NET client you are using for this and it seems the OracleClient support the Cursor datatype and if you use it you should be able to add it as a parameter.
    Sunday, June 10, 2007 4:43 AM