View previous topic :: View next topic
|
Author |
Message |
kumar_ngl Warnings : 1 New User
Joined: 05 Aug 2005 Posts: 50 Location: chennai
|
|
|
|
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 |
|
|
bakarthikeyan
New User
Joined: 21 Sep 2005 Posts: 6
|
|
|
|
No. This won't work out. |
|
Back to top |
|
|
nitin4.a
New User
Joined: 16 Aug 2005 Posts: 26
|
|
|
|
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 |
|
|
kumar_ngl Warnings : 1 New User
Joined: 05 Aug 2005 Posts: 50 Location: chennai
|
|
|
|
Can u tell me hw to use cursor to fetch the first row or last row alone
kumar.p.v |
|
Back to top |
|
|
nitin4.a
New User
Joined: 16 Aug 2005 Posts: 26
|
|
|
|
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 |
|
|
kumar_ngl Warnings : 1 New User
Joined: 05 Aug 2005 Posts: 50 Location: chennai
|
|
|
|
thanks sonu...
Great help...
kumar.p.v |
|
Back to top |
|
|
nitin4.a
New User
Joined: 16 Aug 2005 Posts: 26
|
|
|
|
Welcome
anytime
regards |
|
Back to top |
|
|
kumar_ngl Warnings : 1 New User
Joined: 05 Aug 2005 Posts: 50 Location: chennai
|
|
|
|
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 |
|
|
nitin4.a
New User
Joined: 16 Aug 2005 Posts: 26
|
|
|
|
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 |
|
|
kumar_ngl Warnings : 1 New User
Joined: 05 Aug 2005 Posts: 50 Location: chennai
|
|
|
|
thanx sonu..
here is my id.. kumar_pselvam@yahoo.co.in
kumar.p.v |
|
Back to top |
|
|
|