DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: case inside a cursor

  1. #1
    Join Date
    Jan 2001
    Posts
    153
    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..


    Vijay.s

  2. #2

    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 :-)

  3. #3
    Join Date
    Jan 2001
    Posts
    153
    Okey...but i can still use in PL/SQL block..the restriction is i cannot use it in the CURSOR..

    Vijay.s

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width