ho w to see the output of "Message_Text"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • karanbikash@gmail.com

    ho w to see the output of "Message_Text"

    Hi ,

    I would like to know how to we see the output of "MESSAGE_TE XT " .
    Below is 1 such procedure ..

    create procedure mess_test (out p_sqlstate char(5) , out p_sqlcode
    int )
    language sql
    specific mess_test
    begin
    declare v_count int;
    declare sqlstate char(5) default '00000';
    declare sqlcode int default 0;
    DECLARE c_too_many_rows CONDITION FOR SQLSTATE '99001';
    --declare no_table condition for sqlstate '42704';
    declare exit handler for sqlexception
    select sqlstate , sqlcode into
    p_sqlstate , p_sqlcode
    from sysibm.sysdummy 1;
    select count(*) into v_count from employee;
    if v_count 30 then
    signal c_too_many_rows set message_text = ' Rows More thena
    required ';
    end if;

    end
    DB20000I The SQL command completed successfully.

    ^C
    D:\>db2 call mess_test(?,?)

    Value of output parameters
    --------------------------
    Parameter Name : P_SQLSTATE
    Parameter Value : 99001

    Parameter Name : P_SQLCODE
    Parameter Value : -438

    Return Status = 0


    D:\>

    I am unable to see the " message_text " out put .
    How can we see that . Is their any setting to be changed while
    executing or calling the procedure ,.
    Please let me know about this .
    Thanks a lot .
    Bikash Karan
  • Serge Rielau

    #2
    Re: ho w to see the output of "Message_T ext"

    Try the GET DIAGNOSTICS statement
    --
    Serge Rielau
    DB2 Solutions Development
    IBM Toronto Lab

    Comment

    Working...