Sample Header Ad - 728x90

Catch exception in DB2 function

-3 votes
1 answer
6715 views
I want to catch exception in DB2 function and return 0 if there was an exception. I don't know how the right syntax create function is_decimal(c_data varchar(100)) RETURNS INTEGER begin select cast(c_data as decimal(12,10)) from sysibm.sysdummy1; return 1; DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING return 0; end
Asked by Nir (529 rep)
Sep 1, 2015, 03:00 PM
Last activity: Sep 7, 2015, 07:51 PM