It is hard to see exactly what you are doing.
Looks like a RUNSQLSTM
If so, can you just paste the source code.
BTW, if it is RUNSQLSTM and all you are doing is a SELECT, then that is the problem. With RUNSQLSTM, you can Update, Delete, Insertt, Create, everything except a simple SELECT.