HELP! ESQL program crashes
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Hi all,
We are having trouble getting the following program to work:
/* -*-c-*- */
#include <stdio.h>
$include sqltypes.h;
$include sqlstype.h;
$include sqlca;
$include sqlda;
$define DATPATH "schedule";
void get_mtg_attendee(void) {
$char db_nam[9];
$int id;
int indx;
$database DATPATH;
/* The following declare statement causes a bus error. We've
used $PREPARE to create a query id as well. The error seems
to be occurring in _ungetc which is being called by the
informix function _iqlocate. */
$DECLARE cursor CURSOR FOR
SELECT m_id,
m_user
INTO $id,
$db_nam
FROM meeting
;
EXEC SQL
OPEN cursor;
for(indx = 0; indx < 10; indx++)
EXEC SQL
FETCH cursor;
}
void main(void)
{
get_mtg_attendee();
}
Version INFORMIX-SQL Version 5.02.UC1 on HP-UX hp0 A.09.03 A 9000/755.
Please reply (e-mail preferred) if you have any idea what might be wrong.
Many thanx in advance!
(bertelse@uiuc.edu)