Re: 4GL: Turn off cursor name mangling.
Posted in 1997
I don't know about any environment variables for this. There may still be one though. We use the -globcurs option to c4gl which is definitely documented. That works fine, and we allways include it. We allways used different cursor names for every cursor declared in a set of 4GL modules, so we got no problems with it when it became necessary with version 6.x of 4GL. For others who might read this: Be carefull if you use -globcurs. You will get very strange results if you have two cursors with the same name in different modules. A programmer here did that a short while ago. As I couldn't conceive of that beeing possible I allmost called Informix support and made a post here in c.d.i. of a serious bug in 4GL. You get no errors from doing this. Everything seems to work ok until you relize the cursor is returning the wrong data. Jacob Salomon <jake@apparel.net> wrote: :HELP! My memory needs a kick! : :Q1: What is the name of the environment variable that turns : off cursor name mangling in 4GL? : :Q2: DOes this need to be set at compile time or at run time? : :Now, for the more patient in the Informix community, some explanation is :in order: : :I am using UPDATE WHERE CURRENT OF <cursor_name> in a prepared :statement, thus: : : let scratch # Statement to retrieve the text : = "select long_desc", # blob for the current function : " from gplibdoc", : " where funcname = ?", : " for update" : prepare lock_lib_desc_stmt from scratch : declare lock_lib_desc_curs cursor for lock_lib_desc_stmt : : let scratch : = "update gplibdoc", : " set long_desc = ?", : " where current of lock_lib_desc_curs" : prepare upd_lib_desc_stmt from scratch : :(The fact that this is a blob I'm updating is incidental; I recall it :happening with a non-blob update as well.) : :Note that the name of the FOR UPDATE cursor (lock_lib_desc_curs)is :hard-coded into the second PREPAREd statement. : :Eventually I hit the execute code: : execute upd_lib_desc_stmt # hit it! : using rp_libdoc_ldesc : :I get error -507: The cursor name in the "where current of" clause does :not exist. Huhh???? Ah, yes! 4GL automatically does "cursor name :mangling". I have a vague idea why 4GL does this but the point is, :there is a way to turn off the feature. This involves an environment :variable: NOGLOB or some variation on that name. BTW, NOGLOB is NOT the :variable; I just tried compiling with it set to "1". : :I can't recall the name of the env variable and it does not seem to be :documented; the guide to SQL (Syntax, p 1-239, 1-621) glosses over it, :using esql (which does no cursor name mangling), evading the issue :entirely. : :Anyone remember the name of that &^%$#! environment variable? : :Thanks. :-- : -- Jake (Lost in thought and won't ask for directions) : . . : _..-'( )`-.._ : ./'. '||\\\\. }\\_/{ .//||` .`\\. : ./'.|'.'||||\\\\|.. )o o( ..|//||||`.`|.`\\. : ./'..|'.|| |||||\\`````` \\,@,/ ''''''/||||| ||.`|..`\\. : ./'.||'.|||| ||||||||||||. ||| .|||||||||||| ||||.`||.`\\. : /'|||'.|||||| ||||||||||||{ | }|||||||||||| ||||||.`|||`\\ : '.|||'.||||||| ||||||||||||{ | }|||||||||||| |||||||.`|||.` :'.||| ||||||||| |/' ``\\||`` | ''||/'' `\\| ||||||||| |||.` :|/' \\./' `\\./ \\!|\\ /|!/ \\./' `\\./ `\\| :V V V }' `\\ /' `{ V V V :\\ \\ \\ V / / / :+-----------------------------------------------------------+ :| Impeccable Logic: A thought process which successfully | :| resists chicken bites | :+-----------------------------------------------------------+ Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org