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: Query in a Stored Procedure

Re: Query in a Stored Procedure

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 30 Aug 2001 10:14:43 -0700
Message-ID: <9mlsa302f7k@drn.newsguy.com>


In article <9mlchf$8qh$1_at_slb2.atl.mindspring.net>, "Roman says...
>
>I'm new to Oracle stored procedures (my experience is with MS SQL Server
>stored procedures) and I can't find a way to store a SELECT sql statement
>that will return the result of a query.
>
>In SQL Server, it's okay to have a stored procedure in the form:
>
>CREATE PROCEDURE qryGetDirections
>@JobNum as varchar(20)
>As
>SELECT job, directions_desc
>FROM tblDirections
>WHERE job = @JobNum
>
>When it is run, it simply returns a different result set based on the value
>of JobNum. In Oracle, a similar procedure would give me an error saying
>that I'm missing an INTO clause.
>
>How would I convert the above into PL/SQL and store it as a procedure, or am
>I not able to store queries in an Oracle stored procedure?
>
>

http://osi.oracle.com/~tkyte/ResultSets/index.html

...

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Thu Aug 30 2001 - 12:14:43 CDT

Original text of this message

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