db2 创建function报错

 create function fun_fw_sfyczy(pi_operunitid varchar(2)) 
returns varchar(2)
LANGUAGE SQL 
BEGIN ATOMIC
     DECLARE v_count int;
     set v_count =(select count(1) from fw_operator where operunitid = int(pi_operunitid) and aae100 = '1');
     if v_count = 0 then
        return '0';
     end if;
     return '1';   
END
以上是我创建的函数,求助,哪错了?看了好几遍找不出错误,下面是错误信息
 
 
posted @ 2019-05-09 11:06  Miragic  阅读(413)  评论(0编辑  收藏  举报