Use this stored procedure to check synchronously whether there is a message waiting for the specified QAnywhere message address.
Use the Listener if you want a SQL procedure to be called asynchronously when a message is available for a specified QAnywhere
The message corresponding to the returned message is not considered to be received until the current transaction is committed.
Once the receive is committed, the message cannot be received again by this or any other QAnywhere API. Similarly, a rollback
of the current transaction means that the message is not received, so subsequent calls to ml_qa_getmessage may return the
same message ID.
The properties and content of the received message can be read by the various ml_qa_get stored procedures until a commit or
rollback is executed on the current transaction. Once a commit or rollback is executed on the current transaction, the message
data is no longer readable. Before committing, you should store any data you need from the message as tabular data or in SQL
The following example displays the content of all messages that are queued at the address myaddress until all such messages
are read (it is generally more efficient to commit after the last message has been read, rather than after each message is
declare @msgid varchar(128);
set @msgid = ml_qa_getmessagenowait( 'myaddress' );
if @msgid is null then leave end if;
message 'a message with content ' || ml_qa_gettextcontent( @msgid ) || ' has been received';