Discussion:
SQL RPG clause: WHERE IN ( :ARRAY) ?
(too old to reply)
Hammie
2007-02-23 07:59:04 UTC
Permalink
Hello

I'm trying with SQL ILERPG to make the following clause:

.........
where in ('xxxxx', 'xxxxxx')
I like to use an rpg array in that clause how do I have to do that.

where in ( :arrayname) ?
and if it is possible how do I have coded the array?

Regards
Jaap
mowyourlawn
2007-02-23 12:07:00 UTC
Permalink
What I do is dynamically compose the IN clause in code for each array
element. Just create a FOR statement, loop through the elements, and
concat into one long comma separated string.

HTH,
Aaron Bartell
Hammie
2007-02-26 10:43:35 UTC
Permalink
Post by mowyourlawn
What I do is dynamically compose the IN clause in code for each array
element. Just create a FOR statement, loop through the elements, and
concat into one long comma separated string.
HTH,
Aaron Bartell
Thanks for the reactions,

What I already did was creating a temporaly file in Qtemp with all
that elements and then use
" where in (select * from qtemp/array)

and that work ok

Loading...