Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Carlos San Miguel, using Informix through ODBC, asked how to get the serial value of the last inserted row. Enor P pointed to the SQLCA record. Art S. Kagel gave the answer: SELECT DBINFO('sqlca.sqlerrd1') FROM systables WHERE tabid = 1 returns the last serial assigned in the current session. scottishpoet also suggested DBINFO. Solved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi, I'm going to be using Informix with a customer. I will access
Informix with ODBC. All the tables have a serial column, this is the
ID for the record. I need to know how I can get the value of the
serial column for the last record inserted. A stored procedure maybe?
TIA
Carlos San Miguel
↪ replying to Carlos San Miguel
Enor P — — source: Usenet: comp.databases.informix
Carlos San Miguel wrote:
> Hi, I'm going to be using Informix with a customer. I will access
> Informix with ODBC. All the tables have a serial column, this is the
> ID for the record. I need to know how I can get the value of the
> serial column for the last record inserted. A stored procedure maybe?
SQLCA record contains this ifnormation.
--
Enor
↪ replying to Carlos San Miguel
Art S. Kagel — — source: Usenet: comp.databases.informix
On Mon, 31 May 2004 17:25:10 -0400, Carlos San Miguel wrote:
> Hi, I'm going to be using Informix with a customer. I will access Informix
> with ODBC. All the tables have a serial column, this is the ID for the
> record. I need to know how I can get the value of the serial column for the
> last record inserted. A stored procedure maybe?
>
> TIA
> Carlos San Miguel
SELECT DBINFO('sqlca.sqlerrd1') FROM systables where tabid = 1;
Will return the last serial number assigned to a row inserted by the current
session.
Art S. Kagel
I think you can use "dbinfo" to do this.
dbinfo is kinda like a predefined stored procedure
Enor P <enor_1@hotmail.com> wrote in message news:<2i1mviFhv140U1@uni-berlin.de>...
> Carlos San Miguel wrote:
>
> > Hi, I'm going to be using Informix with a customer. I will access
> > Informix with ODBC. All the tables have a serial column, this is the
> > ID for the record. I need to know how I can get the value of the
> > serial column for the last record inserted. A stored procedure maybe?
>
> SQLCA record contains this ifnormation.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.