Skip to content

Instantly share code, notes, and snippets.

@dkalamari
Created May 2, 2014 11:24
Show Gist options
  • Save dkalamari/bc0d8340421cd1c405c5 to your computer and use it in GitHub Desktop.
Save dkalamari/bc0d8340421cd1c405c5 to your computer and use it in GitHub Desktop.
C# Oracle last inserted id
string sqlInsert = "INSERT INTO users (name, surname) VALUES (:name, :surname) RETURNING id_user INTO :LASTID";
OracleParameter lastId = new OracleParameter(":LASTID", OracleDbType.Int32);
lastId.Direction = ParameterDirection.Output;
...
cmdInsert.Parameters.Add(lastId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment