last value in cursor active set [message #192522] |
Tue, 12 September 2006 13:15 |
basirana
Messages: 25 Registered: July 2006
|
Junior Member |
|
|
Hi
I am writing a program to fetch values from cursor.
I need to put condition to find last value in the active set.
I have tried using %found and %notfound parameters.
Is there anyway I can find last fetch in the for loop.
Thanks
|
|
|
Re: last value in cursor active set [message #192616 is a reply to message #192522] |
Wed, 13 September 2006 00:32 |
sandeepk7
Messages: 137 Registered: September 2006
|
Senior Member |
|
|
Try this
Declare
Cursor c_data is select * from tbl1;
v_data c_data%rowtype;
Begin
Open C_data;
Loop
Fetch C_data into v_data;
if c_data%notfound and c_data%rowcount>1 then
/*c_data%rowcount>1 is condition to check if cursor is having any value Or you can remove it if dont want to put this check.*/
--Your Condition to for Last Value Condition
End Loop;
Close C_data;
End;
Sandy
[Updated on: Wed, 13 September 2006 00:36] Report message to a moderator
|
|
|
|