Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored Procedures
David, I think that the problem may be that the SELECT statement requires a INTO clause to function when it is used within a PL/SQL block, however this would only work if you knew that the query would only return 1 row otherwise you would get a TOO_MANY_ROWS exception. If the query returns more than 1 row you may have to look into using explicit CURSORS (if your writing PL/SQL packages or procedure) or if the data is required in a Forms application investigate using record groups which function in a similar manner to arrays.
Best of luck
Darren Earl.
David Small <102450.3705_at_CompuServe.COM> wrote:
> Can stored procedures return results from a query, much
>like a VIEW can? What I am looking for is something that can
>accept parameters (unlike a VIEW), but return results
>(columns and rows) that can be bound to variables. I have the
>following stored procedure...
>
>CREATE PROCEDURE qryGrowth (lSessionID NUMBER)
>
>BEGIN
>
>SELECT *
>FROM tblGrowth
>WHERE fldSessionID = lSessionID;
>
>END qryGrowth;
>
>When I try to create this procedure, I get a compile error. If I
>replace the SELECT statement with a DELETE, INSERT, or UPDATE
>statement, the procedure compiles fine. Is there a way to return
>a result set?
>
>Thanks,
>Dave
>102450,3705_at_CompuServe.Com
Received on Mon Dec 02 1996 - 00:00:00 CST
![]() |
![]() |