Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (日本語) » QAnywhere » QAnywhere リファレンス » QAnywhere SQL API リファレンス » メッセージのプロパティ、ヘッダ、内容 » メッセージの内容

 

ml_qa_getcontentclass

メッセージ・タイプ (テキストまたはバイナリ) を返します。

パラメータ
項目 説明 備考
1 メッセージ ID VARCHAR(128)。メッセージ ID は、ml_qa_createmessage または ml_qa_getmessage から取得できます。
戻り値

INTEGER 型の内容クラス。

次のいずれかの値を返します。

  • 1   メッセージの内容がバイナリであり、ストアド・プロシージャ ml_qa_getbinarycontent を使用して読み込む必要があることを示します。

  • 2   メッセージの内容がテキストであり、ストアド・プロシージャ ml_qa_gettextcontent を使用して読み込む必要があることを示します。

備考

この内容は、メッセージの受信後からロールバックまたはコミットが行われるまでの間に読み込むことができます。ロールバックまたはコミットが行われた後で読み込むことはできません。

参照

次の例では、メッセージを受信して、その内容をデータベース・サーバ・メッセージ・ウィンドウに出力します。

begin
    declare @msgid varchar(128);
    declare @contentclass integer;
    set @msgid = ml_qa_getmessage( 'myaddress' );
    set @contentclass = ml_qa_getcontentclass( @msgid );
    if @contentclass = 1 then
        message 'message  binary is ' || ml_qa_getbinarycontent( @msgid );
    elseif @contentclass = 2 then
        message 'message  text is ' || ml_qa_gettextcontent( @msgid );
    end if;
    commit;
end