It was a good question to ask: "Is there a way to use an array in the Where clause of a SQL Select statement?"
I am disappointed that it is not possible to use an array in that manner:
01 exec sql SELECT * FROM PERSON 02 WHERE LAST_NAME IN (:MyArray) ; |
This code will not pass the SQL precompile. It gives the following error message in the precompile listing:
MSG ID SEV RECORD TEXT SQL0312 30 13 Position 32 Variable MYARRAY not defined or not usable for reason code 2. |
When I look up that message I see that arrays are not allowed: