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

How get Multipul rows without using cursor?


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Fri Mar 26, 2010 12:54 pm
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

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
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

Moderator Emeritus


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

PostPosted: Mon Apr 12, 2010 7:58 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts How to compare two rows of same table DB2 11
Search our Forums:

Back to Top