创建或替换触发器LM_AFTER_INSERT在离开时插入后_MASTER每行
在"声明@empsal"为PLS-00103 :Encountered the symbol "@" when expecting one of the following
附近出现错误后。。。
数据库中确实存在我的表。
我的触发器:
create or replace
TRIGGER leavemastertrg After INSERT
ON "xyz"."leave_master"
declare @empid int;
declare @empname varchar(100);
declare @empsal decimal(10,2);
declare @audit_action varchar(100);
select @empid=i.LEAVE_ID from inserted i;
select @empname=i.LEAVE_NAME from inserted i;
select @empsal=i.LEAVE_STATUS from inserted i;
set @audit_action='Inserted Record -- After Insert Trigger.';
insert into manager_master
(MANAGER_ID,MANAGER_NAME,MANAGER_STATUS,MANAGER_AUDIT_ACTION,MANAGER_AUDIT_TIMESTAMP)
values(@empid,@empname,@empsal,@audit_action,getdate());
PRINT 'AFTER INSERT trigger fired.'
GO
声明v_username varchar2(20字节);
开始选择用户INTO v_usernameFROM对偶;
INSERT INTO manager_master
( MANAGER_ID,
MANAGER_NAME,
MANAGER_STATUS,
Modified_by)
VALUES
( :new.LEAVE_ID,
:new.LEAVE_NAME,
:new.LEAVE_STATUS,
user);
结束;
这个示例代码在OracleSQL中运行良好。我应用Mysql、oralce-SQL概念的方式不对。谢谢大家。