Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple Cursor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Multiple Cursor
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    Post subject:
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    Post subject:
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Oct 09, 2009 3:10 pm    Post subject:
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    Post subject:
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    Post subject:
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: 6967
Location: porcelain throne

PostPosted: Fri Oct 09, 2009 3:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us