Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Is there an OPEN SQL equivalent for Oracle's DECODE ?

Former Member
0 Likes
1,180

Hi, is there anything similar to ORACLE's DECODE statement I can use in my OPEN SQL query ?

Thanks

Avraham

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
786

Hi,

ANSI's SQL-92 standard foresees for such kind of logic the "CASE" expression. It can be used in the SELECT, WHERE or HAVING component of your SQL statement. I have never tried it in ABAP's open sql, so I am not sure, but maybe it is worth a try?

Kind regards,

Nico

2 REPLIES 2
Read only

Former Member
0 Likes
787

Hi,

ANSI's SQL-92 standard foresees for such kind of logic the "CASE" expression. It can be used in the SELECT, WHERE or HAVING component of your SQL statement. I have never tried it in ABAP's open sql, so I am not sure, but maybe it is worth a try?

Kind regards,

Nico

Read only

Former Member
0 Likes
786

Hi Avraham,

In ABAP we cannot have the exact functionality of DECODE statement, as we cannot compare any expression in WHERE conditon of SELECT statement.

Instead, we can use the IF-ENDIF condition in SELECT-ENDSELECT and then append it into the internal table. But SELECT-ENDSELECT is not adviced to use as it has performance issued.

Hope this helps you.

Regards,

Chandra Sekhar