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