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
 

 

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 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 Can we use OPTIMIZE FOR 1 ROWS for fe... cvijay784 DB2 1 Fri Aug 05, 2016 11:56 am


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