I need the ID of the record I just entered
version: ORACLE 11g
I created the T1 table with 2 columns:
C1 number (value automatically generated by insert command with trigger and sequence)
C2 char(1)
//
my code:
var con as SQLConnectionMBS = …
var sql as string = “INSERT INTO T1 VALUES (‘A’) RETURNING C1 INTO :Id”
var cmd As New SQLCommandMBS (con,sql)
var RetId As Integer = cmd.Param(“Id”).asInteger
cmd.Execute
the result is:
RetId = 0
Id = Nil
nothing changes before or after cmd.Commit
I also tried:
cmd.Execute
var RetId As Integer = cmd.Param(“Id”).asInteger
but again nothing changes
Can @Christian_Schmitz help with this?
thank you.
5 posts - 2 participants