Greetings,
The error message:
sqlca.sqlcode == -424
Cursor already declared from this "prepared" statement.
(It's not listed the error message appendix)
---------------------------------------------------------------------------
The program:
An ESQL/C program which dynamically executes SQL statements. The error
occurs after issuing the following pseudo-statements:
< User enters non-scrolling select statement >
[ $PREPARE query_object from $query_statement ]
[ $DESCRIBE query_object INTO description ]
[ get and assign storage to sqlda structure "description" ]
[ $DECLARE my_cursor CURSOR FOR query_object ]
[ $OPEN my_cursor ]
[ $FETCH, parse sqlda, and display rows (in a loop) ]
[ $CLOSE my_cursor ]
[ $FREE query_object ]
< User enters scrolling select statement >
[ $PREPARE query_object from $query_statement ]
[ $DESCRIBE query_object INTO description ]
[ get and assign storage to sqlda structure "description" ]
[ $DECLARE my_cursor SCROLL CURSOR FOR select_statement ]
[ error -424 ]
---------------------------------------------------------------------------
The environment:
$ what ${INFORMIXDIR}/bin/esql
esql 6.11 11/27/89 14:26:58
INFORMIX-SE Version 4.00.UH1
AT&T 6386/25 WGS running Sys V Rel 3.2
---------------------------------------------------------------------------
First of all, could someone explain the error message. Next, is
the problem occurring because of "cursor scope?" In my ESQL/C course,
the instructor mentioned that cursors are known to all functions in a
single source file. Looking at the generated code verifys that only one
_SQCURSOR structure (_SQ1) is used throughout the program. Would breaking
my one source file into several do any good? As always, thanks for any help.
---
Chris Hardin chris@green.att.com ...!att!green!chris 404.750.5246