Skip to Main Content

Oracle Database Discussions

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!

PL/SQL and ORA-00947: not enough values

653044Apr 13 2011 — edited Jul 11 2013
Hi

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2013
Added on Apr 13 2011
4 comments
4,281 views