RE: Serial (autoincrement) field access
Posted in 1998
Troy, Have a look in the 4GL manual under the heading of SERIAL. You should find a subheading for SQLCA.SQLERRD[2]. This variable is set with the value of the inserted serial column. By the way your right it is dumb to have more than the necessary columns as the key to a row than is necessary to uniquely identify it. You are heading down the road of disaster (opinion only). Regards David Ashby -----Original Message----- From: Troy Peterson [mailto:tp096255@gte.net] Sent: Thursday, 20 August 1998 4:10 To: informix-list@iiug.org Subject: Serial (autoincrement) field access I know this sounds dumb, but... I have 3 fields in the primary key for my table and one of them is of 'serial' type. I want to insert a record into this table and then use the auto-assigned serial number from this field in a batch of records for another table. It seems awful sloppy to have to insert the record, run a query to try and find the record I just inserted, and then create my secondary batch of records. In my case this could result in multiple rows being returned and then I'm up a creek. Is there any way I can get my 'insert' to return the value of the autoincrement field? Is there a system variable that can be used? Any light you can shed on this topic would be greatly appreciated.