Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Returning the largest value from a cursor

Returning the largest value from a cursor

From: Sean Byrne <byrne_sean_spamtrap_at_hotmail.com>
Date: Wed, 06 Oct 2004 19:08:19 +0100
Message-ID: <ck1c98$51i$1$8300dec7@news.demon.co.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US