Bob
Bob

Reputation: 1001

How to define a row type that has columns of different tables?

Normally, I should do something like

my_record my_table%ROWTYPE;

cursor c1 (bla bla) is 
select * from my_tables...

but what happens if I have something like

select b.*, c.col1, c.col2 
from my_table b, mytable1 c ...

how can I define one object like my_record my_table%ROWTYPE that has exactly the columns I need?

Upvotes: 0

Views: 166

Answers (1)

Laggel
Laggel

Reputation: 1386

If you are using a cursor you just need to declare your variable after the cursor as

my_record c1%rowtype;

Upvotes: 3

Related Questions