[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: cursor question
J. McNall,
Regarding Question 2: I think the number of compiles and parses
for a cursor depends on whether the query is dynamic and whether
the value of the dynamic variable changes.
In terms of compiling the SQR, there is a parse that happens
during compilation that is used to determine the data types
for the columns and expressions in the select list. I think this
is the same compile as the one prior to execution.
Ray
> Hello group,
> I have 2 cursor questions for anyone or everyone.
> When I ran a report I got an error = "1808 Cannot find inactive database
> cursor. Program too large."
> So I decided to find out when a cursor is used and how many you can have.
>
> In the SQR users guide for version 4 on page 175-176 It says
>
> The cursor pool consists of 30 cursors, and its size cannot be changed.
> When a SQL statement is re-executed, its cursor can be immediately
> reused if it is still in the cursor pool. When your SQR program executes
> more than 30 different SQL statement, cursors in the pool are reassigned.
>
> But in the SQR language reference manual for version 4 it says on pages
> 345-346:
>
> Entry Default Maximum Entry Description
> CURSORS 6 25 -- (SQLBase) Maximum number of
> concurrent open database cursors.
>
> In addition to increasing the sizes you may also lower them to decrease the
> amount of memory used.
>
>
> This seams contradictory to me, so how many cursors can you have and is that
> number fixed or can you change it?
>
> Question 2
>
> While researching I came across this: (page 175-176)
>
> The listing will also include the number of "compiles," which will vary
> according to the database and the complexity of the query. With Oracle,
> for example, a simple query is compiled only once. With SYBASE, a SQL
> statement is compiled before it is first executed and recompiled for the
> purpose of validation during the SQR compile phase. Therefore, you may
> see two compiles for a SQL statement. Later when the SQL is re-executed,
> if its cursor is found in the cursor pool, it can proceed without
> recompiling.
>
> However, My understanding is that an SQR is compiled and then executed. So
> can someone please interpret this for me because it sounds like it's saying
> it is compiled before execution and then recompiled?
>
> Thank you in advance for your help and comments.
>
> J. McNall
> TGT Solutions Inc.
>
----------------------------------------------------------------------
Ray Ontko rayo@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/