Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: executing a query in a Stored Procedure

Re: executing a query in a Stored Procedure

From: Mark Plant <mplant_at_uk.oracle.com>
Date: Thu, 24 Jun 1999 17:01:07 GMT
Message-ID: <377263d9.22753619@newshost.uk.oracle.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US