sql - Informix: how to get an id of the last inserted record -


what's efficient way of getting value of serial column after insert statement? i.e. looking way replicate @@identity or scope_identity functionality of ms sql

the value of last serial insert stored in sqlca record, second entry in sqlerrd array. brian's answer correct esql/c, haven't mentioned language you're using.

if you're writing stored procedure, value can found thus:

let new_id = dbinfo('sqlca.sqlerrd1'); 

it can found in $sth->{ix_sqlerrd}[1] if using dbi

there variants other languages/interfaces, i'm sure you'll idea.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -