After completion of ml_qa_putmessage, a message expires if it is not received by the intended recipient in the specified time.
The message may then be deleted using default QAnywhere delete rules.
You can read this header after a message is received and until a rollback or commit occurs; after that you cannot read it.
In the following example, a message is received and the message expiration is output to the database server messages window:
begin
declare @msgid varchar(128);
declare @expires timestamp;
set @msgid = ml_qa_getmessage( 'myaddress' );
set @expires = ml_qa_getexpiration( @msgid );
message 'message would have expired at ' || @expires || ' if it had not been received';
commit;
end