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: Compilation error

Re: Compilation error

From: John Hough <q6y_at_ornl.gov>
Date: 1997/03/12
Message-ID: <3326A869.1B4C@ornl.gov>#1/1

Jean wrote:
>
> I have written the following procedure:
>
> create procedure andy as
> begin
> select 'aaa' from dual;
> end;
> /
>
> It compiles with error. I don't understand. Can anyone please enlighten
> me!!!!

SQL> create procedure john as
  2 begin
  3 select 'aaa' from dual;
  4 end;
  5 /

Warning: Procedure created with compilation errors.

SQL> show errors
Errors for PROCEDURE JOHN:

LINE/COL



ERROR

3/1
PLS-00428: an INTO clause is expected in this SELECT statement

3/1
PL/SQL: SQL Statement ignored

Jean:

When you do a show errors after compiling this procedure the message is pretty clear. The problem is that you can't select a value with out placing it into a variable in pl/sql. If you change the procedure as shown below:

 1 create or replace procedure john as
  2 field1 varchar2(3);
  3 begin
  4 select 'aaa' into field1 from dual;   5* end;
SQL> / Procedure created.

It works~!

Hope this helps,

John Hough Received on Wed Mar 12 1997 - 00:00:00 CST

Original text of this message

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