In this blog post, you’ll learn more about the Sybase Error SETUSER not allowed in procedures, triggers, events, or batches and the reason for receiving this error
Sybase SQL Error Message
SETUSER not allowed in procedures, triggers, events, or batches
Reason for this Error
The SETUSER statement is not allowed in stored procedures, triggers, event handlers, or batches, and cannot be called from an EXECUTE IMMEDIATE statement.