Hello,
due to the lack of an testing environment I need to know if the following scenario will work:
I have installed the Oracle Data Provider for .Net version 9.2.0.4. In production I'll have to communicate from my C# application with two Databases, an Oracle 8i and 9i.
Does Oracle 8i support Bind Variables in this scenario?
I'm likely to use code similar to the following:
Thanks in advance!
OracleCommand cmd = con.CreateCommand();
OracleTransaction txn = con.BeginTransaction();
try {
cmd.CommandText = "update MayJun2009 " +
"set balance = balance + :1 " +
"where account_id = :2";
OracleParameter pBalance = new OracleParameter();
pBalance.OracleDbType = OracleDbType.Int32;
OracleParameter pAccount = new OracleParameter();
pAccount.OracleDbType = OracleDbType.Int32;
cmd.Parameters.Add(pBalance);
cmd.Parameters.Add(pAccount);
pBalance.Value = -500;
pAccount.Value = 1;
cmd.ExecuteNonQuery();
pBalance.Value = 500;
pAccount.Value = 2;
cmd.ExecuteNonQuery();
txn.Commit();
}
catch (OracleException ex) {
txn.Rollback();
}