Esql-C Problem
Posted in 1994
I am having a problem using ESQL/C (embedded C) under SCO Unix with Informix SE 5.01. Here is a code snippet: // cursor declared here $open sched_cursor; $fetch sched_cursor into $ctbkno, $ctcasub; // host variables while (sqlca.sqlcode == 0) { // do some processing $fetch sched_cursor into $ctbkno, $ctcasub; } $close sched_cursor; Here is the problem: under certain conditions (yet to ascertain exactly what they are), the program core dumps after the LAST fetch in the cursor. However -- now get this -- if I put the following: strcpy(ctbkno, "---"); immediately before the fetch, IT DOES *NOT* CORE DUMP, and the processing continues as expected. Any idea as to what could be causing this? Bear in mind, the string copy is just init- tializing the host variable "ctbkno". If the fetch retrieves data, ctbkno receives it, overriding the "---" (or whatever dummy string I put there). You shouldn't need the "---", so why would that prevent it from core dumping???? ********************************* Nick Nobbe, Library of Congress NLS/BPH Off: (202) 707-0548 Fax: (202) 707-0711 mail: nnob@seq1.loc.gov *********************************