Re: execute with where current of
Posted in 1998
On 13 Jan 1998, tony flaherty wrote: } on-line version 7.21ud1 } 4gl version 6.05.uc1 Thanks for the info. } I have a problem with code similar to the following; } } LET l_sql = "SELECT * FROM tabname WHERE col1 = ? FOR UPDATE" } PREPARE p_get_em FROM l_sql } DECLARE select_cursor SCROLL CURSOR FOR p_get_em } LET l_sql = "UPDATE tabname } SET ( col1, col2, col3 ) } = ( ?, ?, ? ) } WHERE CURRENT OF select_cursor } PREPARE p_update FROM l_sql } ... } BEGIN WORK } OPEN select_cursor USING a_variable } FETCH select_cursor INTO localrecord.* } ... } EXECUTE p_update USING localrecord.col1, localrecord.col2, localrecord.col3 } } The execute statement gives a "cursor not found" error This is bug B31661. It is absolutely the archetypal scenario for running into the problem. Read the release notes. Look for CURSOR_NAME. Or use -globcurs on the command line. If it isn't in any of the release notes, it should be in the manuals instead. } Remove nospam to reply I was sorely tempted to say absolutely nothing in response to this question because of it. Very, very, very sorely tempted. Yours, Jonathan Leffler (johnl@informix.com) #include <witticism.h>