I'm not experienced with DB2, but from
this explanation of the error message I guess that the DEV database is obtaining the data through a different plan (storing the results in a temp table) for some reason.
Check for any difference between the two databases. I don't know how this is in DB2, but in Oracle a query plan might change for a large number of reasons:
- different indexes,
- different amount of data in table,
- different clustering factor of indexes,
- different collection of statistics (or lack of thereof),
- different system parameters,
- different architecture.
I may be mistaken; it is also possible that DB2 won't switch query plans so readily. But if it does, the feature you use (sensitive resultset) is very fragile and might stop working even after some innocuous change.