oracle触发器设置uuid变量
时间:2021-07-01 10:21:17
帮助过:3人阅读
or replace trigger tri_org_department
after insert or update
on bjlt.sys_org
for each row
declare
v_uuid varchar2(
36);
begin
v_uuid:=sys_guid();
if inserting
then
insert into KEYMS.KEY_DEPARTMENT
@TOBSMS_BETTERY_LOCAL.REGRESS.RDBMS.DEV.US.ORACLE.COM(depid,depcode,depname,parentid)
values(:new.ID,:new.RESERVE4,:new.NAME,:new.P_ID);
insert into KEYMS.KEY_USER
@TOBSMS_BETTERY_LOCAL.REGRESS.RDBMS.DEV.US.ORACLE.COM(userid,username,password,truename,mobile,depid,isuse,issys,isproject)
values(v_uuid,:new.RESERVE4,:new.RESERVE4,:new.NAME,:new.RESERVE4,:new.ID,
1,
0,
0);
insert into KEYMS.KEY_USERROLE
@TOBSMS_BETTERY_LOCAL.REGRESS.RDBMS.DEV.US.ORACLE.COM(USERID,ROLEID)
values(v_uuid,
‘0002‘);
end if;
end;
0913新增组织机构同步门锁组织机构,人员,权限.sql
oracle触发器设置uuid变量
标签: