On Fri, Aug 4, 2017 at 3:12 PM, Steve Needles
<Stephen.Needles@xxxxxxxxxxx> wrote:
It seems that you are after those rows from myfile where they exist in an empty result set? I don't get it.
I'm after the rows from myfile which satisfy certain conditions.
Sometimes, but not always, those conditions will result in no rows
being selected. The conditions are dynamically determined.
In particular, the set of desired myfield2 values will change.
Sometimes I'll want all the rows where myfield2 is in (1, 2, 3). Other
times, I'll want all the rows where myfield2 is in (2, 4). Other
times, I'll want all the rows where myfield2 is in (5). And other
times, I'll want all the rows where myfield2 is in the empty set. The
actual set of desired values is completely arbitrary and determined at
run-time.
I would like a way to express "the set of desired values". Whatever
this expression is (let's call it desiredset) should be able to be
inserted into
select myfield1 from mylib.myfile where myfield2 in (desiredset)
When the set of desired values isn't empty, desiredset can consist of
a comma-separated list of literal values. But when the set is empty,
what should desiredset be? Right now, I don't know anything better
than making desiredset be a SELECT statement which is hard-coded to
return no rows. I'm hoping there is something better than that for the
empty-set case.
John Y.
As an Amazon Associate we earn from qualifying purchases.