Re: Help with Insert (ESQL/C)
Posted in 1993
ERROR ALERT: Popiel goofs again !!!! Details at 11:00 ... Bill Foote (promdist!bill@pds.com) writes: ->From: promdist!bill@pds.com (Bill Foote) ->Subject: Re: Help with Insert (ESQL/C) ->To: informix-list@rmy.emory.edu ->Date: Tue, 26 Jan 93 13:00:01 PST ->In-Reply-To: <9301261539.AA08176@effluvia.den.mmc.com>; from "Alan Popiel" at Jan 26, 93 8:39 am ->Reply-To: promdist!bill@pds.com (Bill Foote) ->> ->> -> I have a scienario where I need to insert into one table ->> ->and one of the columns of the table is of serial datatype. After ->> ->inserting into this table, I need to know what the column value ->> ->is ( the serial type one) and insert this value into another ->> ->table where it is a foreign key. -> ->> The value you want is in global variable 'sqlca.sqlerrd[2]'. ->> ->> In my ESQL/C manual, it's on pages 2-18 ff. For my 4GL colleagues, it's on ->> pages 3-77 ff of I4GL Ref. Manual Volume 1. ->> -> ->In my ESQL/C (version 4.00) manual, it's in sqlca.sqlerrd[1], _not_ ->sqlca.sqlerrd[2]. sqlca.sqlerrd[2] is the number of rows processed. ->I hope that this was just a typo, because I don't want to think ->that something like this would change across versions. -> ->In reference to my previous post (where I claimed that this didn't ->exist in Informix ESQL/C 1.0), I guess that I didn't RTFM closely ->enough way back then. Informix ESQL/C 1.0 _does_ return this value ->in sqlca.sqlerrd[1]. -> ->-- ->Bill Foote bill@pds.com ->MIS Director uunet!promdist!bill ->PDS Corp, Los Angeles, CA USA -> Alan Popiel (alan@den.mmc.com) shame-facedly replies: The typo was mine, in translating from 4GL to C. The correct, corresponding items are addressed as: SQLCA.SQLERRD[2] in 4GL, which subscripts starting at 1 sqlca.sqlerrd[1] in C, which subscripts starting at 0 My (weak) explanation: I normally work in 4GL, *very* seldom in C. This subscript stuff is a standard "gotcha" in moving to C from most other languages. Thanks, Bill, for helping to keep me humble. BTW, this is one reason I cite the ref. manuals, rather than trying to sound like a guru. If you read the manuals, you can recover from my errors, just as you did. BTW #2, does your ESQL/C manual have the same typo error in the struct definition that mine does, regarding 'sqlwarn'? Regards, Alan +------------------------------+---------------------------------------+ | R. Alan Popiel | Internet: alan@den.mmc.com | | Martin Marietta, LSC | ( Please note: My opinions do not ) | | P.O. Box 179, M/S 5422 | ( represent official Martin policy. ) | | Denver, Colorado 80201-0179 | Voice: 303-977-9998 | +------------------------------+---------------------------------------+