Re: esql/c
Posted in 1992
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
In article 21986@informix.com, jerry@godzilla.informix.com (Jerry Pope) writes: >In article 3081@fripp.ri.cadre.com, jh@cadre.com (Joe Hartley) writes: >>In article 6418@advtech.uswest.com, yslas@earpuswest.com ( Rob Yslas) writes: [Sacrifice to the bandwith gods] >>$fetch foo_curs; >> if (sqlca.sqlcode != 0) >> { >> printf("Error %d on initial fetch\\n", sqlca.sqlcode); >> exit; >> } >> >>/* while (sqlca.sqlcode) This is wrong! it should be (!sqlca.sqlcode) */ >> /* In fact, I tend to use (sqlca.sqlcode != 0) for clarity */ >> >>while (sqlca.sqlcode != 0) > ^^ >*** I think you mean "==" here, meaning the fetch got a row. Right? *** > Arrgh. You are correct. In my haste to clarify the use of sqlca.sqlcode, I've proven myself to be less than thourough in my checking of my code. I certainly *did* mean "while (sqlca.sqlcode == 0)", and the comment should go up to the initial fetch error clause. Maybe I need to patch the compiler directly into my news reader so I can compile my examples before I send them :-) =============================================================================== Joe Hartley | jh@cadre.com - Whenever you find that you are on the Cadre Technologies | side of the majority, it is time to reform. - M. Twain 222 Richmond St. | -------------------------------------------------------- Providence, RI 02903 | Overman 1st Class - the Kilgore Trout Memorial Clench (401) 351-5950 x266 | of the Church of the SubGenius ===============================================================================