Re: Help with Insert (ESQL/C)
Posted in 1993
> > > Howdy! > I have a scienario where I need to insert into one table > and one of the columns of the table is of serial datatype. <...> > I would appreicate if you can either mail me or post it on the > news group. Please post, as I'd be interested in any good answers, too. I've often resorted to things like creating my own "serial" values, and storing them in an integer field with a unique index. Mind you, this isn't a terrible thing to do: If I really cared about efficiency, I'd have a small (4 byte) file holding the next sequence number, and access it using open()/read()/write() with the appropriate flock() (or lockf(), depending on your religion) call around the critical region. Of course, it would be _nice_ if the insert statement could just tell me what serial value it just created. I know that this wasn't possible when I looked into it last, but that was Informix ESQL/C version 1.0 (on a 286-based machine, sometime in the late 50's I believe). Perhaps they've added something. -- Bill Foote bill@pds.com MIS Director uunet!promdist!bill PDS Corp, Los Angeles, CA USA