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!

Stored Procedure: Function returns Array

512892Aug 16 2006 — edited Aug 17 2006
I was just wondering if following scenario is possible in a stored procedure.
I have a package, which includes 4 different functions and 1 procedure. Procdure uses ref cursor to return values in my reporting tool. What I am trying to do is to write a function which takes input and return array of varchar. Something like..

Package ABC
Function student_classes (student_no in Varchar2) return [array]
begin
select class_nbr into [array]
from student_table
where student_nbr = student_no;
return [array];
end student_classes;

procedure students_info (rpt_cursor IN OUT rpt_type)
begin
OPEN rpt_cursor FOR
select
student_name,
student_nbr,
student_address,
student_classes (student_nbr) --returns array
from student_table;
end student_info; --end of procedure

end abc; --end of pacakge.

I used [array], as I am ont sure how to define (syntax) it in spec part of package or in body. I will really appreciate if someone could help me with this function.

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2006
Added on Aug 16 2006
4 comments
598 views