Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL problem
> Jan Gelbrich wrote:
>
>> DECODE can only be used in a SQL statement, but not within PL/SQL. >> Source: Oracle SQL Reference by Kreines & Jacobs, O´Reilly.
SQL> create or replace procedure test_ as
2 v_ varchar2(20);
3 begin
4 v_:=decode('aha','AHA','yes','no');
5 dbms_output.put_line(v_);
6 end;
7 /
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE TEST_:
LINE/COL ERROR
-------- ----------------------------------------------------------------- 4/3 PL/SQL: Statement ignored 4/7 PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
I presume, that was the original meaning
Rene Nyffenegger
-- no sig todayReceived on Thu Feb 06 2003 - 04:48:25 CST
![]() |
![]() |