cancel
Showing results for 
Search instead for 
Did you mean: 

Case Syntax in IDT shows error

Former Member
0 Kudos

Hi Experts,

I am stuck up with a weird error while using the Case function the IDT. The data foundation for the universe is a data model (table) from HANA database.

Below is the code which I am using. When I validate, it gives the error (image attached). When i save with the error and come out to check the auto generated script (image attached), there is a bracket in the line no 7 which is causing the error.

Code --> CASE WHEN @Prompt('Enter Date','D',,Mono,Free)='2000-01-01' THEN current_date ELSE @Prompt('Enter Date','D',,Mono,Free) END

Error Msg --> SAP DBTech JDBC: [257] (at 160): sql syntax error: line 7 col 1 (at pos 160)

Auto Generated Script:

SELECT

  Table__1."DATE_SQL"

FROM

  "_SYS_BIC"."sp-dev/AV_MKPF_MSEG_V03"  Table__1

WHERE

( CASE WHEN @Prompt('Enter Date','D',,Mono,Free)='2015-05-01' THEN current_date ELSE @Prompt('Enter Date','D',,Mono,Free) END

)

Appreciate your help.

Thanks,

Rishav.

Accepted Solutions (1)

Accepted Solutions (1)

former_member207052
Active Contributor
0 Kudos

There should be an object reference in the where clause. For example, Sales_Date = case when ....

But in your case after the where clause there is no such column reference and hence the error.

Helps ?

Regards,

Naras

Former Member
0 Kudos

thanks Narashimman....it worked....

Answers (0)