Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Declare a table type with multiple columns

744464Sep 6 2011 — edited Sep 6 2011
I have a table type with one column and I want to create one with two columns.

My type is:
create or replace type "NUMBER_TABLE" as table of number;

And I uses it in function:

FUNCTION GetValues()
return NUMBER_TABLE
as
results NUMBER_TABLE := NUMBER_TABLE();
begin
select OrderId bulk collect into :results from(select * from tbl_orders);
--Some other code...
end;

I want the select be like that:
select OrderId, OrderAddress bulk collect into :results from(select * from tbl_orders);

How to do that?
This post has been answered by lee200 on Sep 6 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2011
Added on Sep 6 2011
6 comments
11,811 views