Hi David,
True, but opening & closing a file isn't nearly as expensive as opening &
closing a cursor (I think).
It depends how the cursor will be closed.
Agreed the first and second time a cursor will be opened in a job it will be
(much) more time intensive than opening a physical or logical file defined
in the F-Specs. But if the cursor is reuseable and not hard closed, all
subsequent opens should be at least as fast as opening a file in the
F-Specs. (If not you have to analyze your SQL code!)
Hard closing a cursor means the ODP will be deleted and the next time the
same cursor must be opened a full optimization must be performed.
A hard close occurs at the end of a module if your SQLRPG program is
compiled with the option CLOSQLCSR = *ENDMOD or as soon as the library list
gets changed and unqualified access to the tables is performed.
Executing the SQL statement CLOSE will only perform a hard close if the SQL
statement is not reuseable. Otherwise only a pseudo close will be performed.
That means the temporary objects used for the ODP will not be deleted and
the next time the cursor will be opened only the data in the temporary
object will be actualized.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces+hauser=sss-software.de@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+hauser=sss-software.de@xxxxxxxxxxxx] Im Auftrag von
David Gibbs
Gesendet: Thursday, October 11, 2007 20:43
An: RPG programming on the AS400 / iSeries
Betreff: Re: SETLL in SQL ?
Buck wrote:
ISAM has powerful weaknesses too: no dynamic ORDER BY, no dynamic
WHERE and no dynamic JOIN. If you need one of those things [1] then
ISAM won't be helpful.
Isn't that what OPNQRYF is for?
Yes indeed. As long as you don't mind doing a CLOSE/OPEN to access
the
dynamic goodies... :-)
True, but opening & closing a file isn't nearly as expensive as opening &
closing a cursor (I think).
david
As an Amazon Associate we earn from qualifying purchases.