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
 

 

FOR FETCH ONLY Statement in Cursor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: FOR FETCH ONLY Statement in Cursor
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    Post subject: Reply to: FOR FETCH ONLY Statement in Cursor
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    Post subject:
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    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 ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm


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