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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -