Receiving SQL Error -76, Cardinality Mismatch, even though query has no INTO
I'm running this code in our application, and in the terminal:
>set query="SELECT * FROM PMG_Data_Private.RemitInstance WHERE (VoucherNumber %INLIST ? SIZE ((10)))"
>set tRS = ##class(%ResultSet).%New("%DynamicQuery:SQL")
ERROR #5540: SQLCODE: -76 Message: Cardinality mismatch between the SELECT-list and INTO-list
SQLTEXT: SELECT * FROM PMG_Data_Private.RemitInstance WHERE (VoucherNumber %INLIST ? SIZE ((10)))
It's not really a problem with the query, since there's no INTO keyword int he query, and I'm not getting it on QA or a production server -- using the same query etc. Another programmer tends to delete cached queries when this happens.
However, I purged cached queries for this statement, this table, and for this namespace, and still receive this error (respectively).
What could be causing this error? It's also appearing in out application, so I don't want to move anything up to production until I know that this won't happen.
Should I try to use the newer %SQL.Statement class? (this is older code)