IN or better a single hostvariable containing a list of values separated by
a comma in composition with an IN predicate cannot be used in this way!
If you want to use IN within static SQL, you need to define and to use a
host variable for each element within the IN Predicate.
... or use dynamic SQL
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
?Train people well enough so they can leave, treat them well enough so they
don't want to.? (Richard Branson)
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
iseriesstuff@xxxxxxxxx
Sent: Donnerstag, 12. Dezember 2019 16:23
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: imbed sql in rpg quesion using "in"
I'm trying to do the following but its not working. Can the "in" be used in
this fashion?
D tc s 8
D list s 5555
*inlr = *on;
tc = '3098002';
list = '904359,956835,964733';
exec sql update aafjie
set fld1 = :tc
where fld2 in (:list);
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.