Re: Accessing row serial number after insert
Posted in 1999
M00n321 — — source: Informix-list mailing list archive (1991-1998)
>I've also considered doing dbinfo('sqlca.sqlerrd1') , to get a serial
>number after an insert. I'm slightly concerned though about what kind of
>locking to use. For example, if the DB is locked at row level, surely an
>insert into another table will update the value in sqlca.sqlerrd1 ? If>the insert and dbinfo are placed in a BEGIN / END will that solve the
>problem ?
The most reliable way to solve the problem is to have the stored procedure
perform the insert and return the serial value in addition to the status. Then
the work can be confined to a transaction managed by informix and not the gui
which probably does something silly like an implied commit anyway.