Dafür gibts den
exec sql prepare MyStmt from :MyStmt;

In der SQLCA hast du alle benötigten Infos.