OraDirect for .NET2 sending multiple statements in one call
Posted: Wed 30 Sep 2009 16:17
I am using OraDirect for .NET 2.0 version 4.60.33 and want to call Oracle with two statements in one call. The following is the code snippet:
try {
ArrayList sqlParams = BuildParameters();
using (OracleConnection conn = new OracleConnection(connectionString))
{
CommandType commandType = CommandType.Text;
OracleParameter[] parameters = (OracleParameter[])sqlParams.ToArray(typeof(OracleParameter));
OracleHelper.ExecuteDataset(conn,
commandType,
operation,
parameters);
}
catch (OracleException oex)
{
}
In the above code, I would like to pass two statements in operation string, something like the following:
Set role read_all_role;
select * from apc_ar_customers;
However this did not work and returned syntax error. Please help.
Thanks.
try {
ArrayList sqlParams = BuildParameters();
using (OracleConnection conn = new OracleConnection(connectionString))
{
CommandType commandType = CommandType.Text;
OracleParameter[] parameters = (OracleParameter[])sqlParams.ToArray(typeof(OracleParameter));
OracleHelper.ExecuteDataset(conn,
commandType,
operation,
parameters);
}
catch (OracleException oex)
{
}
In the above code, I would like to pass two statements in operation string, something like the following:
Set role read_all_role;
select * from apc_ar_customers;
However this did not work and returned syntax error. Please help.
Thanks.