Is this an ESQL/C bug?
Posted in 1997
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Hello: First of all, sorry if you find two copies of the same message. I posted one, my news server went down and I now do not see it. I do not know if the message got posted before the server cashed. Here is the problem: I am upgrading from ESQL/C 5.00 to ESQL/C 7.2 and the following code gives undesirable results. (AIX 4.2 and Online 7.21) #include errno.h int main (int argc, char *argv[]) { EXEC SQL BEGIN DECLARE SECTION; char code[3]; EXEC SQL END DECLARE SECTION; EXEC SQL DATABASE stores7; EXEC SQL DECLARE C1 CURSOR for SELECT code from state; EXEC SQL OPEN C1; for (;;) { EXEC SQL FECTH c1 into :code; /* Please see this */ printf("Error %d SQL %d \\n",errno,SQLCODE); if (SQLCODE != 0 ) break; printf("$s\\n",code); } EXEC SQL CLOSE C1; exit(0); } Well, what happens is that when C1 gets to the last element of the set SQLCODE gets the value 100 (That is expected) but *errno* gets the value 2. I looked into it and 2 is related to file not found. I have a global error check function that reads the value of errno and because this "2" is giving me a lot of trouble. Peviously in ESQL/C 5.00 and aix 3.2.5 errno was always zero. (I believe that this is the desired behaviour ). If you know some solution please e-mail me ccremid@saadev.saa.noaa.gov Thanks in advance Tino