Stored Procedure: Function returns Array
512892Aug 16 2006 — edited Aug 17 2006I 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