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

Need idea to write this code better

Former Member
0 Likes
401

HI,

there is better way to write this code?

IF poss = '1'.

DELETE col_c WHERE sta_act = ' '.

ELSEIF poss = '2'.

DELETE col_c WHERE sta_act = 'X'.

ELSEIF poss = '0'.

ENDIF.

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
386

Use a CASE Statement

2 REPLIES 2
Read only

Former Member
0 Likes
387

Use a CASE Statement

Read only

Former Member
0 Likes
386

hi ,

use this.

case poss.

when '0'.

when '1'.

DELETE col_c WHERE sta_act = ' '.

when '2'.

DELETE col_c WHERE sta_act = 'X'.

endcase.

regards,

venkat.