Cursor scope
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
It used to be that cursors in version 6.X of 4GL were modular in scope, but I have heard that they are global in version 7.X of 4GL. I have gone through the 7.X manuals but scope does not seem to be addressed. Does anybody know? ==================================================================== Harold Luse Phone: (970) 491-4120 Veterinary Teaching Hospital Fax: (970) 491-4123 Colorado State University Pager: (970) 229-8173 Fort Collins, Colorado USA E-mail: hluse@vth.colostate.edu ====================================================================
Luse Harold wrote: > It used to be that cursors in version 6.X of 4GL were modular in scope, > but I have heard that they are global in version 7.X of 4GL. I have gone > through the 7.X manuals but scope does not seem to be addressed. Does > anybody know? There are compiler flags -globcurs and -localcurs to control this. Beware local cursors and the ramifications of bug B31661. Also see CURSOR_NAME() function. I'm not aware of a change in the default behaviour between 6.0x and 7.x, but that doesn't actually mean there wasn't one. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Wow, I had no idea you might be able to do this now...... After years of having to declare cursors modularly, I have come to almost think of this as good style. I can write a quick and dirty program and name a cursor practically anything and link to our system libraries without any worries at all. Then again, I can think of instances in the past where I wished I could declare all my cursors in one module and then use them in another. I think it's a question open to debate. Another question comes to mind since you mention bug B31661. Is there a way for me to get the details on that bug, perhaps through Informix's web site? Jonathan Leffler wrote: > Luse Harold wrote: > > > It used to be that cursors in version 6.X of 4GL were modular in scope, > > but I have heard that they are global in version 7.X of 4GL. I have gone > > through the 7.X manuals but scope does not seem to be addressed. Does > > anybody know? > > There are compiler flags -globcurs and -localcurs to control this. > Beware local cursors and the ramifications of bug B31661. > Also see CURSOR_NAME() function. > > I'm not aware of a change in the default behaviour between 6.0x and 7.x, > but that doesn't actually mean there wasn't one. > > -- > Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) > Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN > #include <disclaimer.h>
Danny Wright wrote: > Wow, I had no idea you might be able to do this now...... > > After years of having to declare cursors modularly, I have come to almost think > of this as good style. I can write a quick and dirty program and name a cursor > practically anything and link to our system libraries without any worries at > all. Then again, I can think of instances in the past where I wished I could > declare all my cursors in one module and then use them in another. I think > it's a question open to debate. Danny, even with local cursors you can access a cursor declared in one module from within another module. You can use the CURSOR_NAME() function that Jonathan mentioned to map the logical name you know the cursor by to the actual mangled, module specific, cursor name. > Another question comes to mind since you mention bug B31661. Is there a way > for me to get the details on that bug, perhaps through Informix's web site? Go to the TechInfo center and login (you can apply for a free login online). Once logged in select <Product Support>Product Defect Query> and search for '31661'. The original case does not have the bug number in it but you will see it if you search for the error number that the bug causes to be returned: 507. Art S. Kagel > Jonathan Leffler wrote: > > > Luse Harold wrote: > > > > > It used to be that cursors in version 6.X of 4GL were modular in scope, > > > but I have heard that they are global in version 7.X of 4GL. I have gone > > > through the 7.X manuals but scope does not seem to be addressed. Does > > > anybody know? > > > > There are compiler flags -globcurs and -localcurs to control this. > > Beware local cursors and the ramifications of bug B31661. > > Also see CURSOR_NAME() function. > > > > I'm not aware of a change in the default behaviour between 6.0x and 7.x, > > but that doesn't actually mean there wasn't one. > > > > -- > > Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) > > Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN > > #include <disclaimer.h>