home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / informix / 3071 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.8 KB  |  52 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!elroy.jpl.nasa.gov!usc!news.service.uci.edu!ucivax!cwi!tony
  3. From: tony@cwi.com (Tony Chang )
  4. Subject: Re: Help with Insert (ESQL/C)
  5. Message-ID: <C1HJo7.Fzv@cwi.com>
  6. Organization: CaseWare, Inc., Irvine, CA
  7. Date: Tue, 26 Jan 1993 23:52:54 GMT
  8. Lines: 42
  9.  
  10. >> Howdy!
  11. >>     I have a scienario where I need to insert into one table
  12. >> and one of the columns of the table is of serial datatype. 
  13. >    <...>
  14. >>     I would appreicate if you can either mail me or post it on the
  15. >> news group.
  16. >
  17. >Please post, as I'd be interested in any good answers, too.  I've often 
  18. >resorted to things like creating my own "serial" values, and storing them 
  19. >in an integer field with a unique index.
  20. >
  21. We use sqlca.sqlerrd[1] here in our environment. We have
  22. Informix OnLine 4.10 and ESQL/C 4.10 running on the
  23. Sun SPARCs.
  24.  
  25. >Mind you, this isn't a terrible thing to do:  If I really cared about
  26. >efficiency, I'd have a small (4 byte) file holding the next sequence
  27. >number, and access it using open()/read()/write() with the appropriate
  28. >flock() (or lockf(), depending on your religion) call around the
  29. >critical region.
  30. >
  31. This approach might work fine in a local environment but will
  32. not work for us since our applications run on multiple machines
  33. of various platforms, and do not necessarily see the "small
  34. (4 byte) file". It is much more efficient to let the OnLine
  35. server handle the mess.
  36.  
  37. >-- 
  38. >Bill Foote                        bill@pds.com
  39. >MIS Director                        uunet!promdist!bill
  40. >PDS Corp, Los Angeles, CA  USA
  41. >
  42. >
  43.  
  44. Tony Chang                    email: tony@cwi.com
  45. Database Engineer             phone: (714) 453-2200 ext. 241
  46. CaseWare, Inc., Irvine, CA
  47. -- 
  48.  
  49. Tony Chang                    email: tony@cwi.com
  50. Database Engineer             phone: (714) 453-2200 ext. 241
  51. CaseWare, Inc., Irvine, CA
  52.