The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

The new esUtility and Oracle

Last post 03-07-2007, 2:12 PM by Y.Wu. 1 replies.
Sort Posts: Previous Next
  •  03-01-2007, 8:20 PM 699

    The new esUtility and Oracle

    Here is the stored procedure we are using in this test, it merely returns the value of the sequence we use for our AggregateTest.

     

    Code:
    CREATE PROCEDURE "MYGENERATION"."PROC_GETNEXTID" 
    (
    pID OUT "AggregateTest"."ID"%type
    )
    IS
    BEGIN

    SELECT SEQ_ID.NextVal INTO pID FROM DUAL;

    END ;

     
    Here is the code that executes the stored procedure, after the call we get the value via the output parameter.

    Code:
    esUtility u = new esUtility();
    u.Schema = "MYGENERATION";

    esParameters esParms = new esParameters();
    esParms.Add("ID", esParameterDirection.Output, DbType.Decimal, 4);
    u.ExecuteNonQuery(esQueryType.StoredProcedure, "PROC_GETNEXTID", esParms);

    esParameter param = esParms["ID"];
    Console.WriteLine(param.Value.ToString());

     

    When fetching an output parameter you have to provide more parameters on the call to Add(), for a typical input parameter all that is need is the name and value.

     

    Code:
    esUtility u = new esUtility();
    u.Schema = "MYGENERATION";

    esParameters esParms = new esParameters();
    esParms.Add("ID", 4);
    DataTable dt = u.FillDataTable(esQueryType.StoredProcedure, "esAggregateTestLoadByPK", esParms);
     
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  03-07-2007, 2:12 PM 843 in reply to 699

    Re: The new esUtility and Oracle

    In the above example, the parameter type and its size are specified when added into esParameters.

    esParms.Add("ID", esParameterDirection.Output, DbType.Decimal, 4); 

    Does this new esUtility class support oracle cursors as output parameters of a customer oracle stored procedure? How to pass the parameter type and size if it is a oracle cursor?

View as RSS news feed in XML