From my own tests, when creating an SQLStmt inside procedure run code (this is a contrived example)

Code:
SQLStmt query;
...