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
 

 

Fetch more than one rows without using CURSOR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
gen_advantage
Currently Banned

New User


Joined: 05 Jun 2005
Posts: 5

PostPosted: Sat Sep 24, 2005 8:47 pm    Post subject: Fetch more than one rows without using CURSOR
Reply with quote

Hai,
I want to fetch more than one rows,but i should not use CURSOR or SELECT * .

Is there any other way to do it?.
Back to top
View user's profile Send private message

ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Sun Sep 25, 2005 5:54 pm    Post subject: Re: SELECTION OFMORE THAN ONE ROWS
Reply with quote

You must use cursor to retrieve more than one row in an application program. Please let us know what is exactly your requirement is, why u dont want to use cursor?
Back to top
View user's profile Send private message
Anbudan

New User


Joined: 07 Sep 2005
Posts: 26
Location: Germany

PostPosted: Mon Sep 26, 2005 2:27 pm    Post subject:
Reply with quote

Hi gen_advantage


If U don't want to use cursor for multiple rows, then follow the steps:

i)Unload(JCL job) the records(rows) into a file
ii)Use this file as a input to ur cobol pgm

if you want more explanation regarding point (i),


feel free to ask
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Nov 03, 2005 9:56 am    Post subject: fetching more than one row
Reply with quote

hi frnd,
the DB2 intro the cursor ops only to retrv the multiple rows. if u are fetching more than one row without the cursor then error no.-811 will be thrown yar.
Back to top
View user's profile Send private message
tam

New User


Joined: 02 Nov 2005
Posts: 12
Location: zz

PostPosted: Thu Nov 03, 2005 1:38 pm    Post subject:
Reply with quote

Yes, Cursor is the only option for retrieving multiple rows else -811 Sqlcode will result
Back to top
View user's profile Send private message
tam

New User


Joined: 02 Nov 2005
Posts: 12
Location: zz

PostPosted: Thu Nov 03, 2005 2:08 pm    Post subject:
Reply with quote

-811 is the multiple row selected
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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


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