Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2008

Tip: Looking for answers? Try searching our database.

ho w to see the output of "Message_Text"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
karanbikash@gmail.com - 27 May 2008 10:31 GMT
Hi ,

I would like to know how to we see the output of "MESSAGE_TEXT " .
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.sysdummy1;
       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 - 27 May 2008 12:51 GMT
Try the GET DIAGNOSTICS statement
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.