Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Procedure Question
Ian Steward wrote in message ...
>I am just starting to learn Oracle so be gentle. Here is my question:
>
>I am trying to create a stored procedure as follows:
>
>CREATE PROCEDURE SP_BOMINQ (ASSY CHAR ) AS
>BEGIN
>SELECT Assembly,Component,Usage,Revision,UOM,Datein,Dateout,ChangId,Line
>FROM BOM
>WHERE Assembly = ASSY
>Order By Line,Datein;
>END;
>
>This will not compile and gives me the following error:
>
>PLS-00428: an INTO clause is expected in this SELECT statement.
>
>I cannot see why I would need an INTO clause in a simple Select statement.
>Can someone advise?
>
>- Ian S.
>
>
Ok, you are trying to make a procedure that will just output your select! it's impossible to do it this way , Oracle wants you to do a "Select into" clause .. (because you are not doing a cursor here... the Select into is the only "select" clause possible outside the declarative section) I think that you didn't undersdant the goal of a procedure, it is to make heavy data manipulation inside the database, if you want to execute a query just spool it into SQL plus !
Read the PL/SQL book that comes with Oracle, it will help you understand the fondamentals...
Patrick Hamou
Oracle DBA
Received on Thu Jul 22 1999 - 22:16:11 CDT