ESQL/C bug?
Posted in 1997
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Hello: We are migrating from ESQL/C v5.00 to ESQL/C V 7.21 and we found that the following code produces undesirable results. Has anyone came across with the same?. Is this a bug? Just to be complete: AIX 4.2 and Informix 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 FETCH c1 INTO :code; printf("ERROR: %d SQL %d \\n",errno,SQLCODE); if (SQLCODE != 0) break; printf("%s\\n",code); } EXEC SQL CODE C1; exit(0); } Well what happens is that when the FETCH gets to the end of the cursor SQLCODE gets 100 (That is right) but errno gets 2 (why??) I looked at the errno = 2 and is related to file not found. We are using generic error logging functions that works with the errno variable and this behaviour (bug??) is causing multiple problems. I run the same code in AIX 3.2.5 and ESQL/C V 5.00 and errno is always zero Yes, I know that I can set errno to zero after an SQLCODE = 100 is is found, but we are talking about many programs. If someone has a better solution please e-mail me ccremid@saadev.saa.noaa.gov Thanks in advance Tino -- Posted using Reference.COM http://www.reference.com Browse, Search and Post Usenet and Mailing list Archive and Catalog. InReference, Inc. accepts no responsibility for the content of this posting.