home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / informix / 3060 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.6 KB

  1. Path: sparky!uunet!destroyer!gatech!emory!emory!not-for-mail
  2. From: promdist!bill@pds.com (Bill Foote)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: Help with Insert (ESQL/C)
  5. Date: 26 Jan 1993 13:23:08 -0500
  6. Organization: Mailing List Gateway
  7. Lines: 30
  8. Sender: walt@mathcs.emory.edu
  9. Distribution: world
  10. Message-ID: <1k3vicINNcpp@emory.mathcs.emory.edu>
  11. Reply-To: promdist!bill@pds.com (Bill Foote)
  12. NNTP-Posting-Host: emory.mathcs.emory.edu
  13. X-Informix-List-ID: <list.1822>
  14.  
  15.  
  16. > Howdy!
  17. >     I have a scienario where I need to insert into one table
  18. > and one of the columns of the table is of serial datatype. 
  19.     <...>
  20. >     I would appreicate if you can either mail me or post it on the
  21. > news group.
  22.  
  23. Please post, as I'd be interested in any good answers, too.  I've often 
  24. resorted to things like creating my own "serial" values, and storing them 
  25. in an integer field with a unique index.
  26.  
  27. Mind you, this isn't a terrible thing to do:  If I really cared about
  28. efficiency, I'd have a small (4 byte) file holding the next sequence
  29. number, and access it using open()/read()/write() with the appropriate
  30. flock() (or lockf(), depending on your religion) call around the
  31. critical region.
  32.  
  33. Of course, it would be _nice_ if the insert statement could just tell
  34. me what serial value it just created.  I know that this wasn't possible
  35. when I looked into it last, but that was Informix ESQL/C version 1.0
  36. (on a 286-based machine, sometime in the late 50's I believe).  Perhaps
  37. they've added something.
  38.  
  39. -- 
  40. Bill Foote                        bill@pds.com
  41. MIS Director                        uunet!promdist!bill
  42. PDS Corp, Los Angeles, CA  USA
  43.