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

  1. Path: sparky!uunet!ukma!gatech!emory!emory!not-for-mail
  2. From: alan@effluvia.den.mmc.com (Alan Popiel)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re:  Help with Insert (ESQL/C)
  5. Date: 26 Jan 1993 17:33:03 -0500
  6. Organization: Mailing List Gateway
  7. Lines: 67
  8. Sender: walt@mathcs.emory.edu
  9. Distribution: world
  10. Message-ID: <1k4e6vINNpgd@emory.mathcs.emory.edu>
  11. Reply-To: alan@effluvia.den.mmc.com (Alan Popiel)
  12. NNTP-Posting-Host: emory.mathcs.emory.edu
  13. X-Informix-List-ID: <list.1824>
  14.  
  15. ERROR ALERT:  Popiel goofs again !!!!  
  16. Details at 11:00 ...
  17.  
  18. Bill Foote (promdist!bill@pds.com) writes:
  19.  
  20. ->From: promdist!bill@pds.com (Bill Foote)
  21. ->Subject: Re:  Help with Insert (ESQL/C)
  22. ->To: informix-list@rmy.emory.edu
  23. ->Date: Tue, 26 Jan 93 13:00:01 PST
  24. ->In-Reply-To: <9301261539.AA08176@effluvia.den.mmc.com>; from "Alan Popiel" at Jan 26, 93 8:39 am
  25. ->Reply-To: promdist!bill@pds.com (Bill Foote)
  26. ->> 
  27. ->> ->    I have a scienario where I need to insert into one table
  28. ->> ->and one of the columns of the table is of serial datatype. After
  29. ->> ->inserting into this table, I need to know what the column value
  30. ->> ->is ( the serial type one) and insert this value into another 
  31. ->> ->table where it is a foreign key.
  32. ->
  33. ->> The value you want is in global variable 'sqlca.sqlerrd[2]'.
  34. ->> 
  35. ->> In my ESQL/C manual, it's on pages 2-18 ff.  For my 4GL colleagues, it's on 
  36. ->> pages 3-77 ff of I4GL Ref. Manual Volume 1.
  37. ->> 
  38. ->
  39. ->In my ESQL/C (version 4.00) manual, it's in sqlca.sqlerrd[1], _not_
  40. ->sqlca.sqlerrd[2].  sqlca.sqlerrd[2] is the number of rows processed.
  41. ->I hope that this was just a typo, because I don't want to think
  42. ->that something like this would change across versions.
  43. ->
  44. ->In reference to my previous post (where I claimed that this didn't
  45. ->exist in Informix ESQL/C 1.0), I guess that I didn't RTFM closely
  46. ->enough way back then.  Informix ESQL/C 1.0 _does_ return this value
  47. ->in sqlca.sqlerrd[1].
  48. ->
  49. ->-- 
  50. ->Bill Foote                        bill@pds.com
  51. ->MIS Director                        uunet!promdist!bill
  52. ->PDS Corp, Los Angeles, CA  USA
  53. ->
  54.  
  55. Alan Popiel (alan@den.mmc.com) shame-facedly replies:
  56.  
  57. The typo was mine, in translating from 4GL to C.  The correct, corresponding 
  58. items are addressed as:
  59.  
  60.    SQLCA.SQLERRD[2]    in  4GL,  which subscripts starting at 1
  61.    sqlca.sqlerrd[1]    in  C,    which subscripts starting at 0
  62.  
  63. My (weak) explanation:  I normally work in 4GL, *very* seldom in C.  This 
  64. subscript stuff is a standard "gotcha" in moving to C from most other 
  65. languages.
  66.  
  67. Thanks, Bill, for helping to keep me humble.  BTW, this is one reason I cite 
  68. the ref. manuals, rather than trying to sound like a guru.  If you read the 
  69. manuals,  you can recover from my errors, just as you did.  BTW #2, does your 
  70. ESQL/C manual have the same typo error in the struct definition that mine does, 
  71. regarding 'sqlwarn'?
  72.  
  73. Regards,
  74. Alan
  75. +------------------------------+---------------------------------------+
  76. | R. Alan Popiel               | Internet: alan@den.mmc.com            |
  77. | Martin Marietta, LSC         | ( Please note: My opinions do not   ) |
  78. | P.O. Box 179, M/S 5422       | ( represent official Martin policy. ) |
  79. | Denver, Colorado 80201-0179  | Voice: 303-977-9998                   |
  80. +------------------------------+---------------------------------------+
  81.  
  82.