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

Home -> Community -> Usenet -> c.d.o.server -> Re: newbie plsql question

Re: newbie plsql question

From: Keith Jamieson <Keith.Jamieson_at_phoenix.ie>
Date: Fri, 17 Nov 2000 11:50:10 -0000
Message-ID: <8v365r$p9l$1@kermit.esat.net>

Or you could manually define a record based on the columns in the joined tables and then return based on the record type. I do this all the time

sybrandb_at_my-deja.com wrote in message <8v2rf8$2an$1_at_nnrp1.deja.com>...
>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 - 05:50:10 CST

Original text of this message

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