Infomix / ODBC / SQL question
Posted in 2001
Topics: Connectivity: ODBC / JDBC / .NET, Connectivity: ESQL/C, 4GL & Embedded SQL
Hi, I'm trying to write visual basic code to insert records into multiple tables in an Informix database, using ODBC / SQL from a win2k web server. How can I : a) Ensure database consistency by rolling back if all the inserts don't complete sucessfully b) Obtain the value of a serial field for the record I've inserted in a table. I know how to do this in SQL Server but unfortunately I've never used Informix before. The Informix guys here know how to do it in 4GL, but have never used SQL / ODBC and don't know how to replicate the functionality. Can I just use 4GL code in a similar way to pass-through queries in Access / SQL Server? Thanks in advance Jeff
Jeff wrote: > I'm trying to write visual basic code to insert records into multiple tables > in an Informix database, using ODBC / SQL from a win2k web server. How can I > : > a) Ensure database consistency by rolling back if all the inserts don't > complete sucessfully use SQLExecSirect(handle, 'ROLLBACK WORK', 13) after testing every insert for success and find one or more that are unsuccessful? Sort of as the manual suggests? > b) Obtain the value of a serial field for the record I've inserted in a > table. I don't know the answer to this, which is why I did not respond any sooner. I just did a quick bash of the CLI 2.5 (antique) manual and didn't find an answer to this. It may be that a select on DBINFO is the way to find out, but it feels unbearably clumsy. > I know how to do this in SQL Server but unfortunately I've never used > Informix before. The Informix guys here know how to do it in 4GL, but have > never used SQL / ODBC and don't know how to replicate the functionality. Can > I just use 4GL code in a similar way to pass-through queries in Access / SQL > Server? I'm not sure what you're asking in your last sentence? I4GL isn't available on Win2K, so I don't see how you get to pass anything from Visual Basic to I4GL. -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"