-
My Version
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
PL/SQL Release 8.1.7.0.0 - Production
CORE 8.1.7.0.0 Production
TNS for Solaris: Version 8.1.7.0.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
issue
------
DECLARE
CURSOR s1 IS SELECT '1','2',CASE WHEN 1=2 THEN 1 ELSE 4 END xx FROM dual
BEGIN
FOR c1 IN s1
LOOP
dbms_output.put_line('xx');
END LOOP;
END;
--I AM GETTING THIS ERROR..
ORA-06550: line 2, column 29:
PLS-00103: Encountered the symbol "CASE" when expecting one of the following:
( - + mod null
table avg count current max min prior sql stddev sum variance
execute the forall time timestamp interval date
--The same thing works fine with a simple sql statement on EXECUTE IMMEDIATE..
-
not in PLSQL
I cant remember where I read this (im looking for it now) but I thinkthat the cse statement is supported in SQL but not in PLSQL - hence your SQL is fine its the PLSQL that is the problem. As I say, I cant find the source for that but im looking :-)
-
Okey...but i can still use in PL/SQL block..the restriction is i cannot use it in the CURSOR..