Trying to use RETURNING to get ID.
Code: Select all
myConn.Open();
OracleCommand myCommand = new OracleCommand(
"INSERT INTO T (NUM, VAL) VALUES (:NUM, :VAL) RETURNING ROWID INTO :Parameter1", myConn);
myCommand.ParameterCheck = true;
myCommand.Prepare();
myCommand.Parameters[0].Value = 60;
myCommand.Parameters[1].Value = 10;
myCommand.Parameters.Add("Parameter1", oracleDbType.RowId).SourceColumn = "ROWID";
myCommand.Parameters["Parameter1"].Direction = ParameterDirection.[b]Output[/b];
myCommand.ExecuteNonQuery();
int Param1 = myCommand.Parameters["Parameter1"].Value;
Console.WriteLine(Param1.ToString);
MyCommand.close();
This shouldn't work shoun't it?
-Kurt