Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Returning the largest value from a cursor
Hi,
Newbie question:
I have the following cursor for which I wish to return only the largest unique_id at one stage of my PL-SQL.
CURSOR LastActivityCursor (cin_fk_job INTEGER) is
select o.unique_id
FROM homs.t_objects o
where o.Fk_Job = cin_fk_job
and o.type = 'ACTIVITY'
and o.status_id = 1;
If I rewrite the cursor to do:
select MAX(o.unique_id)...
when I try and use c_rec1.unique_id later in the script it barfs with:
ORA-06550: line 52, column 44:
PLS-00302: component 'UNIQUE_ID' must be declared
What am I doing wrong?
Cheers,
Sean
Received on Wed Oct 06 2004 - 13:08:19 CDT