Cursor name mangling
Posted in 1998
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Internationalization & Character Sets
I've got a program that's been running ducky in 4GL 4.11.
Now, I have a shiny new computer with spanking fresh 4GL 7.2 on it,
and I'm trying to port the code over.
I've getting the -4317 error:
Cursors must be uniquely declared within one program module.
That's all just fine, save for:
$ fgrep -f prepare_and_declare header.4gl
prepare read_specs from scratch
declare h_cursor cursor for read_specs
prepare str_lwhse from scratch
declare cur_lwhse cursor for str_lwhse
prepare str_lbox1 from scratch
declare cur_lbox1 cursor for str_lbox1
prepare str_lbox2 from scratch
declare cur_lbox2 cursor for str_lbox2
prepare str_lcarr from scratch
declare cur_lcarr cursor for str_lcarr
prepare str_lcust from scratch
declare cur_lcust cursor for str_lcust
prepare str_ldest from scratch
declare cur_ldest cursor for str_ldest
prepare str_lfob from scratch
declare cur_lfob cursor for str_lfob
prepare str_dup_chk from scratch
declare cur_dup_chk cursor for str_dup_chk
You'll notice that none of these duplicate. For obvious reasons, I
suspected that perhaps the problem was with the lbox1 and lbox2
cursors. cur_lbox happens to be 8 characters, but I can't find
anywhere that tells me how many characters in a cursor/statement
declaration are supposed to be unique. I was thinking more than 8
though.
But, the problem isn't with lbox1 and lbox2. The problem is with the
ldest section. Comment these two lines out of the code, and it
compiles just fine. Heck, it doesn't even complain that I'm USING
cur_ldest later in the code.
This tells me that the names are being mangled internally by the
compiler, and that regardless of what I actually call the cursors,
Informix has its own idea and this seems to be an example of a name
collision using its internal hashing routine.
Now, I seem to recall that since the older 4GLs were using module scope
cursors compared to the current global scope cursors (mind you, it
doesn't say this in the 6.0 manual, which is the current bulk
documentation, I think, though there may be an exception noted in one
of the 7.2 manuals - they're all a bit arduous to navigate). I also
recall there being a switch that mangled the file name into the cursor
name for "hack^H^H^H^Hbackward compatability", but I can't find that
switch either.
Not that this switch would necessarily fix this specific problem as it
just happens being affecting only one module.
So.
How many characters are considered significant in determining the
uniqueness of a cursor name?
What is the switch to mangle in the filename to the cursor names? Does
it exist in 7.2 anymore?
Renaming the ldest cursor/statment to ldest1 fixes the problem, but
this is certainly annoying. Any other hints out there?
Thanx.
--
Will Hartung - Rancho Santa Margarita. It's a dry heat. vfr750@netcom.com
1990 VFR750 - VFR=Very Red "Ho, HaHa, Dodge, Parry, Spin, HA! THRUST!"
1993 Explorer - Cage? Hell, it's a prison. -D. Duck
Related threads
- Re: 11.50.xC4 Compression with workgroup edition?
- FW: Gurus
- Re: RE: Gurus
- wait for mutex ... IDS hang....
- Queries waiting for mutex