DBI/DBD-informix, value of a new serial after insert

DBI/DBD-informix, value of a new serial after insert

Post by Anton Slabbin » Sun, 31 Dec 1899 09:00:00



Does anyone have any idea who I can get the new value for a serial field
after an insert via DBD/DBI ?

In MySQL, I can do this :
(id is of type serial.)

sth-> do ("INSERT INTO table (id) VALUES (0)");
print $dbh->func("_InsertID");

Does DBD-Informix have a equivalent for func(3_InsertID2) ?

Anton.

 
 
 

DBI/DBD-informix, value of a new serial after insert

Post by William Harr » Sun, 31 Dec 1899 09:00:00



says...

Quote:>sth-> do ("INSERT INTO table (id) VALUES (0)");
>print $dbh->func("_InsertID");

>Does DBD-Informix have a equivalent for func(3_InsertID2) ?

Informix 7 has the dbinfo('sqlca.sqlerrd1') function that can be used in a
select statement.
--

Check out the NAGS spam filter.  http://www.nags.org

 
 
 

DBI/DBD-informix, value of a new serial after insert

Post by ?yvind Gjerst » Sun, 31 Dec 1899 09:00:00



> Does anyone have any idea who I can get the new value for a serial field
> after an insert via DBD/DBI ?

> In MySQL, I can do this :
> (id is of type serial.)

> sth-> do ("INSERT INTO table (id) VALUES (0)");
> print $dbh->func("_InsertID");

> Does DBD-Informix have a equivalent for func(3_InsertID2) ?

$dbh->{ix_sqlerrd}[1];
--
?yvind Gjerstad    Systems dept Tollpost-Globe AS  N-6301 ?ndalsnes/Norway

 
 
 

1. How to retrieve the serial value for a new inserted row

Hi,

I need to retrieve the value for a column with serial data type when I
insert a new row using VisualBasic and ODBC connection.

In 4GL I can use the SQLCA record, but how I can do the same using
VisualBasic an ODBC?

I'm running Informix Online 5.02 and Informix Star on a SCO box.

Thanks for your help

Manuel Ortiz
:-)

2. Comparison of values.

3. Indexes via DBI driver in Perl (DBD::Informix)

4. Where to find REXX???

5. DBI and DBD::Informix installation problems

6. RFD: comp.databases.codebase

7. DBI / DBD Informix -- Spaces in data

8. Problem in in Inserting records in Fox Table using OPENROWSET()

9. DBI/DBD for INFORMIX-SE 7.24.UC5 for Linux Redhat

10. DBD-Informix and DBI

11. Informix & DBD::DBI

12. Perl DBI-0.93 DBD-Informix-0.58 on SCO

13. Strange behavior of DBD/DBI Informix