Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: executing a query in a Stored Procedure
You either have to select INTO a PL/SQL variable, provided the table
you are selecting from has only one row in it, or you have to declare
a cursor for the select statement and loop through the result set in
the procedure body.
I suggest you curl up with a copy of the Oracle PL/SQL User's Guide and Reference for a few hours.
Mark
On Wed, 23 Jun 1999 19:35:07 GMT, nealgran_at_my-deja.com wrote:
>When I try to perform a query in a stored procedure it does not compile.
>
>The PL/SQL syntax I used is as follows:
>
> Create Procedure GetInfo AS
> BEGIN
> select Field1 from MyTable;
> END;
>
>Does this have to do with the handling of the resultant table from the
>query? If I replace the query with a directive the Stored procedure
>compiles.
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Thu Jun 24 1999 - 12:01:07 CDT