@@Identity
Posted in 2004
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET
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
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
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.