Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How get Multipul rows without using cursor?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
babu_hi

New User


Joined: 11 Apr 2006
Posts: 93

PostPosted: Fri Mar 26, 2010 10:59 am    Post subject: How get Multipul rows without using cursor?
Reply with quote

i am posting one of the interview question below,
How get Multipul rows without using cursor?
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Mar 26, 2010 12:54 pm    Post subject:
Reply with quote

Hello Babu,

I dont think we can get multiple rows without using cursor but there is a way to get multiple row using single fetch. Please refer the below

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.relg/fmlt.htm
Back to top
View user's profile Send private message
kondru

New User


Joined: 22 Mar 2010
Posts: 11
Location: india

PostPosted: Mon Apr 12, 2010 6:04 pm    Post subject:
Reply with quote

Hello Babu,

Cursor will be used to address the individual row, When your SQL is returned more than one row.. I dont think, handling multiple rows is possible.


Regards,
KDR
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Apr 12, 2010 7:58 pm    Post subject:
Reply with quote

Hello,

Quote:
I dont think, handling multiple rows is possible.
Yes, it is. Suggest you look in the db2 sql manual for "host-variable array".

Both multi-row insert and multi-row fetch are supported. . . And these have significant performance improvements over one-row-at-a-time. . .

But keep in mind the original question was how to to fetch multiple rows without a cursor.
Back to top
View user's profile Send private message
kaustubhkhole

New User


Joined: 20 Oct 2008
Posts: 19
Location: Hyderabad

PostPosted: Sun Apr 25, 2010 1:42 am    Post subject:
Reply with quote

gr8 Find indeed icon_biggrin.gif
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us