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

FOR FETCH ONLY Statement in Cursor


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

New User


Joined: 30 Oct 2006
Posts: 10

PostPosted: Mon Sep 15, 2008 4:10 pm
Reply with quote

Hi All,

I have a requirement to Add fetch only statement to cursor to increase the performance.

Few of my Queries are

1. Cursor has Simple select query and "no such statment as FOR UPDATE of " etc . Also program in not performing Update/Delete/insert on table.

2. Cursor has Simple select query and "no such statment as FOR UPDATE of " etc . Program in doing Update/Delete/insert on table in some paragraph in table with simple Query (Does not contain any statement as FOR CURRENT OF CURSOR-NAME"

Please inform whether FOR FETCH ONLY can be added to cursor or not. Also if there is any other scenario for not adding the stattement please inform.
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Mon Sep 15, 2008 7:39 pm
Reply with quote

Yes, you can use FOR FETCH ONLY clause in your cursor to make the returned columns read only.

As the result table from a SELECT on a view defined as read-only is also read only ,you can use this clause but it has no effect.

Cris
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Mon Sep 15, 2008 8:33 pm
Reply with quote

In addition all cursors defined on 2 or more tables are by default treated as READ ONLY ....
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 Fetch data from programs execute (dat... DB2 3
No new posts Code Multi Row fetch in PL1 program PL/I & Assembler 1
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
Search our Forums:

Back to Top