View previous topic :: View next topic
|
Author |
Message |
tweety25
New User
Joined: 16 Mar 2007 Posts: 3 Location: India
|
|
|
|
We have 3 cursors in a program as follows:
open cursor1
Fetch the records
do when not sqlcode 100
open cursor2
fetch cursor2
process
close cursor2
open cursor3
fetch cursor3
process
close cursor3
end do
close cursor1
Write to an output file.
We have to reduce the time taken for excution. It takes atleast 20 mins to execute the program.
Will the Option of Opening all the cursors at one time, processing the record set and then at end close all the cursors instead of Open, fetch and close help?
Is there any other way?
Please let me know. |
|
Back to top |
|
|
raghunathns
Active User
Joined: 08 Dec 2005 Posts: 127 Location: rochester
|
|
|
|
first two cursors can be comnined to one. because 2nd is depend on 1st one.
the third cursor is like a stand alone cursor. this can be modified depending on the actual functionality of the program. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How many rows need to be fetched from each table for processing this program?
How many of the predicates are via a key/index?
What do the select statements with the 3 curssors look like?
How often and at what time(s) is this program run? |
|
Back to top |
|
|
|