ml_qa_gettimestamp

Returns the creation time of the message.

Parameters
Item Description Remarks
1 Message ID VARCHAR(128). You can obtain the message ID from ml_qa_createmessage or ml_qa_getmessage.
Return value

The message creation time as TIMESTAMP.

Remarks

The Timestamp header field contains the time a message was created. It is a coordinated universal time (UTC). It is not the time the message was actually transmitted, because the actual send may occur later due to transactions or other client-side queuing of messages.

You can read this header after a message is received and until a rollback or commit occurs; after that you cannot read it.

See also
Example

In the following example, a message is received and the creation time of the message is output to the database server messages window:

begin
    declare @msgid varchar(128);
    declare @ts timestamp;
    set @msgid = ml_qa_getmessage( 'myaddress' );
    set @ts = ml_qa_gettimestamp( @msgid );
    message 'message received with create time: ' || @ts ;
    commit;
end