Re: Prepared SQL Statements and Performance
Posted in 1996
In article <4fptn2$1kh@spectator.cris.com> Dbauer@cris.com "Danni Bauer" writes: > brent@hypercom.co.nz (Brent Jackson) wrote: > > >Sally Woolrich <Sally@excelsis.demon.co.uk> wrote: > > >>I have often seen code where cursors are declared within loops so > >>the same cursor is declared each time the loop executes. This certainly > >>is *highly* inefficient as it should almost *always* be possible to > >>declare the cursor (once!) before the loop. The only case I can think > >>of is where the cursor which is declared depends on the data which is > >>present in the loop - note, not that the same cursor uses different > >>data in each iteration! > > <clip> > > >I was under the impression that Declare statements were compile time > >statements that set up data area for cursor retrieval. Hence it makes no > >difference where the Declare gets put. The Declare statement does not set > >the status variable (at least not up to 4.10). The thought I had in mind was that I can think of situations where the cursor to be declared depends on the data in program variables at run time, which therefore means that when it is declared matters! -- ============================================================================ Sally Woolrich | This mail contains my personal sally@excelsis.demon.co.uk | views not those of my employer! ============================================================================