Getting a serial index back
Posted in 1995
Jeff Pickett — — source: Informix-list mailing list archive (1991-1998)
Ok, this has got to be an easy one for the majority of you. So here it is: I have a header record with a serial index on it, so after I insert the header record into table 1, I would like to know what that serial number is so I can put it in the detail record I am about to insert into table 2. So how do I find what serial number was just used? The obvious solution is to get a max on that field after the header has been inserted, but that would only work if there was one user on the table. Or I could get the max, and then verify if it is the right record with an additional select, but that would take an additional select. There must be a more graceful way. Say it's so... Jeff Pickett