Re: ESQL/C problem (Scroll cursor)
Posted in 2003
Jonathan Leffler <jleffler@earthlink.net> wrote in message news:<gaLib.479$7a4.348@newsread4.news.pas.earthlink.net>... > 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'. We have now installed CSDK 2.81.UC1 (including ESQL/C 9.53.UC1)in /SSW/informix/csdk/2.81.UC1 and recompiled. (We have IDS 9.40.FC1 in /SSW/informix/ids/9.40). The same problem (error message from using an non allowed operation on a non scroll cursor) still remains. I'll ask the programmer/developer (that's not me) if he can supply more information here about the source code. Regards Christian Eriksson