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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Dope needs help with retrieving records from stored procedure

Re: Oracle Dope needs help with retrieving records from stored procedure

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 17 Jun 2004 18:58:23 -0700
Message-ID: <2687bb95.0406171758.53926b19@posting.google.com>


jerel_at_rockbaby.com (spawncamper) wrote in message news:<f2f4fe50.0406171212.49ae637c_at_posting.google.com>...
> I'm fairly new to Oracle, so I apologize in advance if this question
> makes you shake your head. However, I'm trying to create a stored
> procedure in Oracle 8i to return a value that would be called using
> SELECT EMPLOYEEID FROM EMPLOYEELASTNAME('JONES') where
> EMPLOYEELAASTNAME would be the name of the procedure and would
> obviously return the id.
>
> When I create a proc to do a select, I get a "an INTO clause is
> expected in this SELECT statement" error. Doing research on the
> internet has not been fruitful. Any assistance for would be greatly
> appreciated.
>
> Thanks,
>
> An Oracle Dope

If you want to reference the stored code as a select list item you want to use a stored function rather than a stored procedure. See CREATE FUNCTION in your SQL manual.

A stored function or user function differs from a stored procedure mostly in that functions are really intended to be referenced in select lists or where clauses and return one value. Other than the create and return line the coding of a function is nearly identical to a procedure.

HTH -- Mark D Powell -- Received on Thu Jun 17 2004 - 20:58:23 CDT

Original text of this message

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