Re: Prepared SQL Statements and Performance
Posted in 1996
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 DECLARE statement sets up data areas in the back-end process at run time. When the cursor is FREEd, the data space becomes available. Executing the DECLARE statement will set STATUS to indicate success or failure. Danni Danni Bauer Dbauer@concentric.net Unix/Informix/C <a href="http://www.concentric.net/~Dbauer">Home Page</a> <a href="http://www.concentric.net/~Dbauer/RESUME.shtml">Resume</a>