Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Compilation error
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
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
![]() |
![]() |