ESQL/C problem (Scroll cursor)
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration, Platform-Specific Issues, Versions, Editions & End-of-Life
Hi! On Siemens Reliant Unix (32-bit) we have a client program accessing IDS 7.31.UC2A (32-bit) via shared memory. The client program is compiled from "INFORMIX EMBEDDED SQL for C Version 7.24.UC3" (32-bit). The embedded sql contains some cursor operations (excerpt from the source code below): line 153: struct sqlda *descript_stack; line 156: sql_buffer = statement; line 157: EXEC SQL PREPARE sql_id FROM :sql_buffer; line 162: EXEC SQL DESCRIBE sql_id INTO descript_stack; line 179: EXEC SQL DECLARE sql_cursor CURSOR FOR sql_id; line 182: EXEC SQL OPEN sql_cursor; line 733: EXEC SQL FETCH sql_cursor USING DESCRIPTOR descript; We have now tried to port this program to the Solaris 8 operating environment (64-bit). On the Solaris 8 system we're using IDS 9.40.FC1 (64-bit). We have for programming reasons choosed to compile the client on the 32-bit "INFORMIX EMBEDDED SQL for C Version 9.40.UC2" and to connect locally via the TCP/IP interface. Now, to the problem we're faced with. When running the program we get a 482 error message when trying to exec a FETCH on the sql_cursor (line 733). "finderr 482" says: You cannot issue a FETCH PRIOR, FETCH FIRST, FETCH LAST, FETCH CURRENT, FETCH RELATIVE n, or FETCH ABSOLUTE n statement with a non-scroll cursor. To do so, you must first declare the cursor as a scroll cursor. We don't get this on Reliant Unix, though we've compiled from the same source code, so why do we get it on Solaris? Regards Christian Eriksson
Christian Eriksson wrote: > On Siemens Reliant Unix (32-bit) we have a client program accessing IDS > 7.31.UC2A (32-bit) via shared memory. The client program is compiled > from "INFORMIX EMBEDDED SQL for C Version 7.24.UC3" (32-bit). The > embedded sql contains some cursor operations (excerpt from the source > code below): > > line 153: struct sqlda *descript_stack; > line 156: sql_buffer = statement; > line 157: EXEC SQL PREPARE sql_id FROM :sql_buffer; > line 162: EXEC SQL DESCRIBE sql_id INTO descript_stack; > line 179: EXEC SQL DECLARE sql_cursor CURSOR FOR sql_id; > line 182: EXEC SQL OPEN sql_cursor; > line 733: EXEC SQL FETCH sql_cursor USING DESCRIPTOR descript; > > We have now tried to port this program to the Solaris 8 operating > environment (64-bit). On the Solaris 8 system we're using IDS 9.40.FC1 > (64-bit). We have for programming reasons choosed to compile the client > on the 32-bit "INFORMIX EMBEDDED SQL for C Version 9.40.UC2" and to > connect locally via the TCP/IP interface. Now, to the problem we're > faced with. When running the program we get a 482 error message when > trying to exec a FETCH on the sql_cursor (line 733). "finderr 482" says: > > You cannot issue a FETCH PRIOR, FETCH FIRST, FETCH LAST, FETCH CURRENT, > FETCH RELATIVE n, or FETCH ABSOLUTE n statement with a non-scroll > cursor. To do so, you must first declare the cursor as a scroll > cursor. > > We don't get this on Reliant Unix, though we've compiled from the same > source code, so why do we get it on Solaris? Not sure - there's no obvious reason why you would. However, ESQL/C 9.40 is quite old (the current version is 9.53, I think), so one possibility is 'bug' and the solution might well be 'upgrade'. You don't show how you are creating 'descript'; you describe into descript_stack. The answer may lie somewhere in that treatment, though it also distinctly possible that you have two separate functions, one around lines 140-200 that prepares a statement for work, and another at (say) lines 720-750 which fetches the data. I'd worry that somewhere, something is using something thought to be a 4-byte quantity which is actually an 8-byte quantity, or vice versa, and this is throwing an interface out of kilter. But I'm not sure about that - and it might be the 'bug'. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Some additional information: The "INFORMIX EMBEDDED SQL for C Version 9.40.UC2" we're using is part of the INFORMIX-Client SDK Version 2.50.UC2 product. /Christian Christian Eriksson <c-eriks@algonet.se> wrote in message news:<PmDib.29011$mU6.74544@newsb.telia.net>... > Hi! > > On Siemens Reliant Unix (32-bit) we have a client program accessing IDS > 7.31.UC2A (32-bit) via shared memory. The client program is compiled > from "INFORMIX EMBEDDED SQL for C Version 7.24.UC3" (32-bit). The > embedded sql contains some cursor operations (excerpt from the source > code below): > > line 153: struct sqlda *descript_stack; > line 156: sql_buffer = statement; > line 157: EXEC SQL PREPARE sql_id FROM :sql_buffer; > line 162: EXEC SQL DESCRIBE sql_id INTO descript_stack; > line 179: EXEC SQL DECLARE sql_cursor CURSOR FOR sql_id; > line 182: EXEC SQL OPEN sql_cursor; > line 733: EXEC SQL FETCH sql_cursor USING DESCRIPTOR descript; > > We have now tried to port this program to the Solaris 8 operating > environment (64-bit). On the Solaris 8 system we're using IDS 9.40.FC1 > (64-bit). We have for programming reasons choosed to compile the client > on the 32-bit "INFORMIX EMBEDDED SQL for C Version 9.40.UC2" and to > connect locally via the TCP/IP interface. Now, to the problem we're > faced with. When running the program we get a 482 error message when > trying to exec a FETCH on the sql_cursor (line 733). "finderr 482" says: > > You cannot issue a FETCH PRIOR, FETCH FIRST, FETCH LAST, FETCH CURRENT, > FETCH RELATIVE n, or FETCH ABSOLUTE n statement with a non-scroll > cursor. To do so, you must first declare the cursor as a scroll > cursor. > > We don't get this on Reliant Unix, though we've compiled from the same > source code, so why do we get it on Solaris? > > Regards Christian Eriksson