PL/SQL and ORA-00947: not enough values
653044Apr 13 2011 — edited Jul 11 2013Hi
sorry if this is not the best forum to post this in, but I looked in PL/SQL and could not find what seemed to be the right "sub category" and was unable to discover how to post at the general level.
Anyway..
I'm trying to build a collection with the ultimate aim of returning a REF CURSOR to PHP on the collection.
At first I wanted to make a collection to begin understanding how I should make my structures (sorry, too much time in the past as a C programmer). Aside: I work for an educational facility (as will become clear by the names in my application).
First within the package spec I defined a type:
type student_list is table of student_course%rowtype;
then in the package body I defined a procedure:
procedure course_progress_report(p_course_id in varchar2, p_out OUT SYS_REFCURSOR) is
student_activity student_list := student_list();
begin
select *
into student_activity
from student_course scrs
where scrs.course_id = p_course_id;
end;
I tried to compile this and get the "00947" error. The part which is strange to me is that I will be returning some hundred or so rows and I have the collection type defined as the %rowtype of the table I'm selecting from.
any assistance or pointers to readings will be appreciated
thanks