IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Multiple Cursor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
psriv20
Currently Banned

New User


Joined: 25 May 2009
Posts: 19
Location: Pune

PostPosted: Fri Oct 09, 2009 12:36 pm
Reply with quote

Hi,

Can we open multiple cursor in one para and fetch all in another para.finally close all of them in last para?

Ex.

Can we do like below....

Procedure Division.
INITIALISATION SECTION.
Open A
Open B
Open C

MAIN-PROCESS SECTION.
Fetch A
Fetch B
fetch C

TERMINATION SECTION.
Close A
Close B
Close C



Above question is asked to keep in mind of optimization.Is there any other way to save CPU utilisation time?

Waiting for your reply.

Thanks
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Fri Oct 09, 2009 12:53 pm
Reply with quote

Yes you can open them in same para.....but how will this save your CPU utilization. icon_question.gif icon_question.gif ....better go for tunning your queries icon_idea.gif ..
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Fri Oct 09, 2009 1:34 pm
Reply with quote

HI,
When you open a cursor the table is look for that moment until u have given with UR, you can optimise the query and this will save the CPU, keeping the cursor open for long time no use is wastage of resources available . you can ask for the query some one can help you in that !
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Oct 09, 2009 2:52 pm
Reply with quote

Ketan Varhade wrote:
HI,
When you open a cursor the table is look for that moment until u have given with UR, you can optimise the query and this will save the CPU, keeping the cursor open for long time no use is wastage of resources available . you can ask for the query some one can help you in that !

what ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 09, 2009 3:10 pm
Reply with quote

Quote:
When you open a cursor the table is look for that moment until u have given with UR


GuyC,
I imagine Ketan Varhade meant LOCK and not LOOK.
But we both know that this post is just another example of somebody talking about something of which they have no knowledge.

UR has nothing to do with locks generated by the task using UR cursor.
UR means that the locks of other tasks do not inhibit the access of Uncommited data by the task using UR.

There has been a lot of garbage written last few days about db2, locks, UR, etc.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Oct 09, 2009 3:16 pm
Reply with quote

not just locks, also holding resources and stuff ..

dbzTHEdinosauer wrote:
There has been a lot of garbage written last few days about db2, locks, UR, etc.
I know, but I just point it out a little less aggressive than you ;)
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Fri Oct 09, 2009 3:16 pm
Reply with quote

Sorry that i meat for with hold not UR
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Oct 09, 2009 3:22 pm
Reply with quote

Suggest that you find out what WITH HOLD means. Has nothing to do with locks.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top