首页 > 代码库 > oracle触发器设置uuid变量

oracle触发器设置uuid变量

create or replace trigger tri_org_departmentafter insert or updateon bjlt.sys_orgfor 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变量