Hi All,
I have
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
in a db2 function. The function does not compile and gives me an error message saying
administrator.FUNCTION1: 11: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQ" was found following "ic declare tmp int; ". Expected tokens may include: "<space>". LINE NUMBER=11. SQLSTATE=42601
What is going wrong. The function body is
CREATE function test()
returns int
LANGUAGE SQL
begin atomic
declare tmp int;
DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
BEGIN
end
return 1;
end