Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to use the SQL SELECT statement, but wish to limit record based on the CONCAT() value.
However, I am at lost how I do it.
Lets say, we have such table:
So, CONCAT(Chr(39)&Orders&Chr(39),',') will produce a string: 'aa','bb','cc','dd','ee'.
I would like to make a SELECT query on the mainframe so that only these 5 orders are selected.
SELECT ...... FROM PUR.ORDERS WHERE 'aa','bb','cc','dd','ee'.
But how could I pass 'aa','bb','cc','dd','ee'. into this SQL statement?
Do I have to SELECT once with a massive data, then narrow the record in the pattern of preceding load?
I would appreciate for your feedback in advance.
Sorry I was stupid. It was solved by this:
Let Scope =Peek('Orders',0);
SELECT ...... FROM PUR.ORDERS WHERE Orders in ($(Scope));