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: 1278
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: 6966
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: 1278
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: 6966
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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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