home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!destroyer!gatech!emory!emory!not-for-mail
- From: promdist!bill@pds.com (Bill Foote)
- Newsgroups: comp.databases.informix
- Subject: Re: Help with Insert (ESQL/C)
- Date: 26 Jan 1993 13:23:08 -0500
- Organization: Mailing List Gateway
- Lines: 30
- Sender: walt@mathcs.emory.edu
- Distribution: world
- Message-ID: <1k3vicINNcpp@emory.mathcs.emory.edu>
- Reply-To: promdist!bill@pds.com (Bill Foote)
- NNTP-Posting-Host: emory.mathcs.emory.edu
- X-Informix-List-ID: <list.1822>
-
-
- >
- >
- > 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
-