Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem in converting CASE statement into DECODE

Newbie
 
Join Date: Aug 2005
Location: Pune, India
Posts: 23
#1: Aug 26 '05
Hello everyone,

I'm facing problem in converting CASE statements into DECODE. As i have PL/SQL 8i, so it does not handle CASE statements. Please send me the solutions . Then basic problem is the CASE has NOT condition i.e. <> ...... and this particularly i'm not able to convert in DECODE.

Please send me the solution as early as possible.. I'm stuck up !!!
I'm giving below the CASE statements and the DECODE statements which i have written and which have some problem.....

CASE statrement is:-

CASE
WHEN SUBSTR (CIL_GET_ACCOUNT_SEGS (ACD.CODE_COMBINATION_ID), 17, 7) <> '0032682'
THEN ACD.ACCTD_AMOUNT * -1
ELSE 0
END SERVICE_TAX

the DECODE which i wrote is :-

DECODE(SUBSTR (CIL_GET_ACCOUNT_SEGS (ACD.CODE_COMBINATION_ID), 17, 7) <> '0032682'),(ACD.ACCTD_AMOUNT* -1), 0) SERVICE_TAX


Please let me know what is correct DECODE statement......

Thanks
Richa

Newbie
 
Join Date: Aug 2005
Posts: 1
#2: Aug 29 '05

re: Problem in converting CASE statement into DECODE


change your code as below:

DECODE(SUBSTR (CIL_GET_ACCOUNT_SEGS (ACD.CODE_COMBINATION_ID), 17, 7),'0032682',0,ACD.ACCTD_AMOUNT * -1)
Reply


Similar Misc bytes