I have got an interesting topic on DB SQL WHERE clause. The below way of SQL improves DB2 performance. The below query tells how to use ARRAY of variables in ‘IN’ list.
Ex:
WHERE ABS_TD IN (:WS-LIST)
Let’s assume WS-LIST has (A,B,C,D), then cursor will fetch all matching results into result table. The fetch executes one by one row.
Here, we need to make sure, the data type of subordinate item (WS-LIST), should be DCLGEN data type.
Ex:
05 WS-LIST Redefined WS-LIST-INP1
10 LIST-ONE PIC s9(4) COMP.
Related Posts







2 responses
[…] my installment #1 if you miss […]
LikeLike
[…] https://srinimf.wordpress.com/2011/12/15/db2-where-in/ Share this:TwitterFacebookLike this:LikeBe the first to like this post. […]
LikeLike