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!

Return result set using select into

593835Aug 20 2007 — edited Aug 20 2007
Hi, would it be possible for a function to return a resultset?

I have the following command which i need to alter to actually return a resultset instead of just executing, how can i do that?
DECLARE
   student_rows  student%rowtype;
BEGIN
   SELECT student.* INTO student_rows  FROM student WHERE STU_ID in ('123');
END;
The select statement must be between begin-end clause because there are other statements in the code which i removed.

The other issue i have is that i need to return multiple rows which makes the declaration part of the code invalid since it only expects a single row.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2007
Added on Aug 20 2007
11 comments
847 views