Hi,
Here we are getting the following error while running the batch job in Bods.
Environment: BODS v3.2 and MS SQL SERVER 2008R2.
Has here we are applying multiple Nested IFTHENELSE statements in multiple Query Transforms in a dataflow, it is supporting upto 3 Query
transforms, in further Query Transforms, it is throwing the runtime error.
Below are the some sample Nested IFTHENELSE stmts we are applying.
Ex. 1:
ifthenelse( SAMPLE.LIST_PRICE_AMT is null or SAMPLE.LIST_PRICE_AMT=0,
(ifthenelse( SAMPLE.LIST_PRICE_AMT_ALT is null OR SAMPLE.LIST_PRICE_AMT_ALT=0,0,SAMPLE.LIST_PRICE_AMT_ALT)),
SAMPLE.LIST_PRICE_AMT)
Ex.2:
(ifthenelse(exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_ADJ_AMT is null OR exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_ADJ_AMT=0,
(ifthenelse(exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_ADJ_AMT_ALT is null OR exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_ADJ_AMT_ALT=0,
(ifthenelse(exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_PRICE_AMT is null OR exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_PRICE_AMT=0,
(ifthenelse(exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_PRICE_AMT_ALT is null OR exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_PRICE_AMT_ALT=0, 0,
exp_CALC_DELTAS_MOVE_BUCKETS_1.v_LIST_PRICE_AMT - exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_PRICE_AMT_ALT)),
exp_CALC_DELTAS_MOVE_BUCKETS_1.v_LIST_PRICE_AMT - exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_PRICE_AMT)),
exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_ADJ_AMT_ALT)), exp_CALC_DELTAS_MOVE_BUCKETS_1.REGIONAL_ADJ_AMT)) * -1
etc....
Below is the Runtime error msg:
SQL submitted to ODBC data source <WIN-K3IS84PVBBJ> resulted in error <[Microsoft][SQL Server Native Client 10.0][SQL
Server]Case expressions may only be nested to level 10.>. The SQL submitted is <SELECT ((0 - ( (CASE WHEN ((((((( (CASE WHEN ((
"SAMPLE"."LIST_PRICE_AMT" IS NULL ) or ( "SAMPLE"."LIST_PRICE_AMT" = 0))
THEN ( (CASE WHEN (( "SAMPLE"."LIST_PRICE_AMT_ALT" IS NULL ) or ( "SAMPLE"."LIST_PRICE_AMT_ALT" = 0))
THEN 0
ELSE "SAMPLE"."LIST_PRICE_AMT_ALT" END) )
Screen shot attached.
Can any one help us, it's an very urgent issue to resolve.
Thanks in advance,
Sreedhar K