Re: Help with Insert (ESQL/C)
Posted in 1993
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
>> 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. > We use sqlca.sqlerrd[1] here in our environment. We have Informix OnLine 4.10 and ESQL/C 4.10 running on the Sun SPARCs. >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. > This approach might work fine in a local environment but will not work for us since our applications run on multiple machines of various platforms, and do not necessarily see the "small (4 byte) file". It is much more efficient to let the OnLine server handle the mess. >-- >Bill Foote bill@pds.com >MIS Director uunet!promdist!bill >PDS Corp, Los Angeles, CA USA > > Tony Chang email: tony@cwi.com Database Engineer phone: (714) 453-2200 ext. 241 CaseWare, Inc., Irvine, CA -- Tony Chang email: tony@cwi.com Database Engineer phone: (714) 453-2200 ext. 241 CaseWare, Inc., Irvine, CA