Re: PB 6.0, Informix SE, and Serial Columns
Posted in 1998
On Fri, 31 Jul 1998 14:02:46 GMT, rajsingh@hotmail.com (Rajendra Singh) wrote: >I have an application which inserts rows into a table that has a serial column. >How do I determine the (serial) value of the last row I inserted? > >I know using ESQL/C, you can get that value from sqlca.sqlerrd[1], but how can >you get it using PowerBuilder 6.0? If you had mentioned the type and version of your engine the answer would have been simpler to give. In version 7.x OnLine at least (not sure about SE) you can simply execute the following sql right after the insert: select dbinfo('sqlca.sqlerrd1') from table_with_one_row If you have no table that's guaranteed to allways have only one row you can of course also use a where clause that makes sure only one row is returned. Many use systables where tabid = 1 or something similar. If you are on 5.x online you don't have the dbinfo function. In that case there are some stored procedures at the http://www.iiug.org site. I don't remember where. Possibly in the FAQ or the software repository. On SE i don't know if any of these options work on any version. The dbinfo option should work though on 7.x versions. Nils Myklebust NM Data AS Norway E-mail: Nils.Myklebust@nmdata.com FAQ at: http://www.iiug.org/techinfo/faq/faq_top.html (Now with ODBC info under "Third party products".)