oracle中存储过程的写法
存储过程常规语法:
实际业务例子:
CREATE OR REPLACE TRIGGER "TRI_B00_02_ONLY_GUID"
BEFORE/AFTER INSERT OR UPDATE OR DELETE ON B00_02
FOR EACH ROW
declare
t_guid varchar2(300) := ''; --GUID
t_cnt int := 0;
BEGIN
t_guid := :NEW.B00_02_09;
if t_guid is not null then
select count(1) into t_cnt from b00_02 t where t.b00_02_09 = t_guid;
if t_cnt > 0 then
raise_application_error('-20001', 'GUID已经存在,不允许插入!');
end if;
end if;
END;
原文地址:https://blog.csdn.net/hazhanglvfang/article/details/140691783
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!