This procedure is different from all the other QAnywhere stored procedures in that the stored procedure is not provided. If
you create a stored procedure named ml_qa_listener_queue, where queue is a message queue, then it is used by QAnywhere.
Although messages can be received synchronously on a connection, it is often convenient to receive messages asynchronously.
You can create a stored procedure that is called when a message has been queued on a particular address. The name of this
procedure must be ml_qa_listener_queue, where queue is the message queue. When this procedure exists, the procedure is called whenever a message is queued on the given address.
This procedure is called from a separate connection. As long as a SQL error does not occur while this procedure is executing,
the message is automatically acknowledged and committed.
The following example creates a procedure that is called whenever a message is queued on the address named executesql. In
this example, the procedure assumes that the content of the message is a SQL statement that it can execute against the current
CREATE PROCEDURE ml_qa_listener_executesql(IN @msgid VARCHAR(128))
DECLARE @execstr LONG VARCHAR;
SET @execstr = ml_qa_gettextcontent( @msgid );
EXECUTE IMMEDIATE @execstr;