Search code examples
oraclecasecognos

CASE expression in SQL throws ORA-00905


I have the below code in Cognos. When I validate it throws ORA-00905.

SELECT 
(CASE WHEN #prompt('prompt_name','string',"'A'")# = 'A' then ABC = 'S'
ELSE ABC END)
FROM table_name;

Thanks for the help!!!


Solution

  • You don't need to use assignment here ABC = 'S'. Your query must look like this:

    SELECT 
        (CASE 
            WHEN #prompt('prompt_name','string',"'A'")# = 'A' then 'S'
            ELSE ABC 
        END)
    FROM table_name;