on 06-07-2013 4:30 PM
Hi,
Getting error when trying to parse the following case statement in BOXI 3.1 Universe.
here i am using 2 tables.
ORDE.DW_CUST and ORDE.DW_CUST_SEG
let me know if i am doing wrong.
CASE
WHEN ORDE.DW_CUST.BILL_CODE='IP1' THEN ORDE.DW_CUST_SEG.PRCSSNG_CODE='ICP'
ELSE
WHEN ORDE.DW_CUST.BILL_CODE='IP2' THEN ORDE.DW_CUST_SEG.PRCSSNG_CODE='ICP'
ELSE
ORDE.DW_CUST_SEG.PRCSSNG_CODE='OTH'
END
Error Message: Parse Failed: Exception: DBD, ORA-00905: missing keyword State:N/A
Hi Praveen,
For your case single case is sufficient I guess. Try below
CASE
WHEN (ORDE.DW_CUST.BILL_CODE='IP1' AND ORDE.DW_CUST_SEG.PRCSSND_CIDE='ICP') OR (ORDE.DW_CUST.BILL_CODE='IP2' AND ORDE.DW_CUST_SEG.PRCSSND_CIDE='ICP')
THEN 'ICP'
ELSE
'OTHER'
END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try below
CASE
WHEN ORDE.DW_CUST.BILL_CODE='IP1' AND ORDE.DW_CUST_SEG.PRCSSNG_CODE='ICP' THEN *********
ELSE
WHEN ORDE.DW_CUST.BILL_CODE='IP2' AND ORDE.DW_CUST_SEG.PRCSSNG_CODE='ICP' THEN ***********
ELSE
*************
END
Cheers,
Suresh Babu Aluri.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
it worked only for single CASE statement
WORKED:
CASE
WHEN ORDE.DW_CUST.BILL_CODE='IP1' AND ORDE.DW_CUST_SEG.PRCSSND_CIDE='ICP'
THEN 'ICP'
ELSE 'OTHER'
END
FAILED:
CASE
WHEN ORDE.DW_CUST.BILL_CODE='IP1' AND ORDE.DW_CUST_SEG.PRCSSND_CIDE='ICP'
THEN 'ICP'
ELSE
WHEN ORDE.DW_CUST.BILL_CODE='IP2' AND ORDE.DW_CUST_SEG.PRCSSND_CIDE='ICP'
THEN 'ICP'
ELSE
'OTHER'
END
Hi Praveen,
Have you tried executing this code directly against Oracle (say using Toad or SqlPlus)? Do you get any error?
Also are you using this code in SELECT clause or WHERE clause?
Regards,
Yuvraj Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.