Juanita
helloworld20131456
采纳率0%
2017-06-22 14:16 阅读 769

DB2触发器中的return为什么报错?

CREATE OR REPLACE TRIGGER "BAOPROG"."trg_dbt_sample_code200_upd"
AFTER UPDATE
on "BAOPROG"."DBT_SAMPLE"
referencing old as oldrow new as newrow
for each ROW
BEGIN ATOMIC
declare v_ep varchar(1);
set v_ep = '0';
set v_ep = substrb(newrow.smpno, 14, 1);

IF substrb(newrow.smpno, 14, 1) <> '0' THEN
return; --加了这个return为什么就报错。
END IF;
END

出错信息如下:
22:10:58 [CREATE - 0 row(s), 0.000 secs] {0:0} DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=;;0' THEN
return; JOIN , DRIVER=4.13.127
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐