Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: newbie plsql question
In article <8v2nkp$un7$1_at_nnrp1.deja.com>,
george096_at_my-deja.com wrote:
> Hopefully it is an easy question but I seem to find no mention to it
in
> the pl sql manual.
>
> How to declare a cursor variable type that return rows from multiple
> tables?
>
> The examples in manual show:
>
> TYPE Emp_val_cv_type IS REF CURSOR RETURN Emp_tab%ROWTYPE;
>
> where %rowtype represents the rows in the emp_tab table.
>
> What if my cursor will select from multiple tables with join?
>
> How to declare the rowtype?
>
> In procedure, I can do something like:
>
> cursor c1 is select... from table1, table2, table3 where ...;
> r1 c1%rowtype;
>
> but I want to use packages and need to declare the cursor type in the
> package declaration. can %rowtype support more than 1 table here?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
You'll need to use a weakly typed ref cursor. so REF CURSOR without any
%ROWTYPE spec.
Hth,
-- Sybrand Bakker, Oracle DBA All standard disclaimers apply ------------------------------------------------------------------------ Sent via Deja.com http://www.deja.com/ Before you buy.Received on Fri Nov 17 2000 - 02:49:45 CST