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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
kumar_ngl
Warnings : 1

New User


Joined: 05 Aug 2005
Posts: 50
Location: chennai

PostPosted: Wed Sep 14, 2005 11:57 pm    Post subject: row selection
Reply with quote

hi all,


Select * from emp first only;

will this querry retreives the first row alone???

if it is right how abt the last row ...

kumar.p.v
Back to top
View user's profile Send private message

bakarthikeyan

New User


Joined: 21 Sep 2005
Posts: 6

PostPosted: Thu Sep 22, 2005 12:36 am    Post subject:
Reply with quote

No. This won't work out.
Back to top
View user's profile Send private message
nitin4.a

New User


Joined: 16 Aug 2005
Posts: 26

PostPosted: Thu Sep 22, 2005 10:31 am    Post subject: Re: row selection
Reply with quote

Hi


as said by bakarthikeyan its true ,this will not work but if u want to have first and last u use cursors
Back to top
View user's profile Send private message
kumar_ngl
Warnings : 1

New User


Joined: 05 Aug 2005
Posts: 50
Location: chennai

PostPosted: Thu Sep 22, 2005 10:35 am    Post subject: Re: row selection
Reply with quote

Can u tell me hw to use cursor to fetch the first row or last row alone

kumar.p.v
Back to top
View user's profile Send private message
nitin4.a

New User


Joined: 16 Aug 2005
Posts: 26

PostPosted: Thu Sep 22, 2005 11:00 am    Post subject: Re: row selection
Reply with quote

HI


you can use scrollable cursors ,declare them as
EXEC SQL DECLARE C1 SCROLL CURSOR FOR........

and then can use Fetch

the command is: EXEC SQL FETCH ABSOLUTE +5 C1......

for the fifth row

EXEC SQL FETCH ABSOLUTE -1 C1........

for the last row

and absolute -5 for the fifth row from last


Hope this will help you

regards
sonu
Back to top
View user's profile Send private message
kumar_ngl
Warnings : 1

New User


Joined: 05 Aug 2005
Posts: 50
Location: chennai

PostPosted: Thu Sep 22, 2005 12:36 pm    Post subject: Re: row selection
Reply with quote

thanks sonu...

Great help...

kumar.p.v
Back to top
View user's profile Send private message
nitin4.a

New User


Joined: 16 Aug 2005
Posts: 26

PostPosted: Thu Sep 22, 2005 12:48 pm    Post subject: Re: row selection
Reply with quote

Welcome


anytime


regards
Back to top
View user's profile Send private message
kumar_ngl
Warnings : 1

New User


Joined: 05 Aug 2005
Posts: 50
Location: chennai

PostPosted: Thu Sep 22, 2005 1:01 pm    Post subject: Re: row selection
Reply with quote

hi sonu,

If u have time..plz send me a sample cobol pgm which retreives and inserts table values

I can provide u ..if u want my mail id for that

thanks,
kumar.p.v
Back to top
View user's profile Send private message
nitin4.a

New User


Joined: 16 Aug 2005
Posts: 26

PostPosted: Thu Sep 22, 2005 1:11 pm    Post subject: Re: row selection
Reply with quote

hi

u want a pgm using scrollable cursors

whole

i can send you the sql part rest u can easly copy from any previous one using non-scrollable(simple) Cursor

give your id

regards
Back to top
View user's profile Send private message
kumar_ngl
Warnings : 1

New User


Joined: 05 Aug 2005
Posts: 50
Location: chennai

PostPosted: Thu Sep 22, 2005 3:28 pm    Post subject: Re: row selection
Reply with quote

thanx sonu..

here is my id.. kumar_pselvam@yahoo.co.in

kumar.p.v
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 $AVRS File Selection Screen Gary Rose All Other Mainframe Topics 0 Tue Jul 01, 2014 7:52 pm
No new posts Joinkeys conditional selection of rec... ksouren007 DFSORT/ICETOOL 6 Wed Nov 13, 2013 7:36 pm
No new posts sort with selection and updating the ... smileseenu DFSORT/ICETOOL 1 Fri Feb 15, 2013 5:27 pm
No new posts Random selection of output data Michael Simpson DFSORT/ICETOOL 10 Thu Oct 04, 2012 12:43 pm
No new posts Forcing a single (or no) selection wi... PeterHolland TSO/ISPF 5 Thu Aug 30, 2012 4:15 pm

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