#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    1
    Rep Power
    0

    Oracle Error PLS-00103 Encountered the sysbol "CASE"


    Hi All,
    I am trying compile a procedure with the following statement.
    select (CASE WHEN 10 <= 2 THEN 10 ELSE 20 END)
    INTO out_val FROM DUAL;

    But it is throughing an Error with the following message
    PLS-00103 Encountered the sysbol "CASE" when expecting one of the following: .....etc.

    I am using Oracle 8.1.7.4.

    If Run that statement at SQL > prompt in SQL* PLUS it is working fine.

    Thanks for your help
    Last edited by subbu; January 15th, 2004 at 12:35 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    Can you post your PL/SQL block?
    El éxito consiste en una serie de pequeñas victorias día a día

    MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html
  4. #3
  5. No Profile Picture
    Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Canada
    Posts
    308
    Rep Power
    11
    following code is working fine in oracle9i

    declare
    out_val number;
    begin
    select (CASE WHEN 10 <= 2 THEN 10 ELSE 20 END)
    INTO out_val FROM DUAL;
    dbms_output.put_line(out_val);
    end;


    i am unable to test it in oracle8i. sorry for that.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    68
    Rep Power
    11
    This variant of the CASE expression is definitely available with Oracle 8.1.7 SQL, but as you experienced it is not available with 8.1.7 PL/SQL.

    Cheers,
    Dan
  8. #5
  9. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    Are you "translating" from MsSQL or do you dislike "decode"?

IMN logo majestic logo threadwatch logo seochat tools logo