首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

PLS-00561:字元集参数 RIGHT 的值不符

2014-01-28 
我写的触发器如下,但提示有错误,错误提示为: PLS-00561:字元集参数 RIGHT 的值不符! CREATE OR REPLACE TRI

我写的触发器如下,但提示有错误,错误提示为:

PLS-00561:字元集参数 RIGHT 的值不符


CREATE OR REPLACE TRIGGER DBAUSER.TUPDATE_TSURPLUS
BEFORE DELETE OR INSERT OR UPDATE
ON DBAUSER.T_OVERTIME
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
TMPVAR1 NUMBER;
TMPVAR2 NUMBER;
BEGIN
  TMPVAR1:=0;
  TMPVAR2:=0;
  IF INSERTING THEN
  SELECT COUNT(*) INTO TMPVAR1 FROM T_TOTALSURPLUS WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:NEW.VRTMSORT;
  IF TMPVAR1> 0 THEN
  UPDATE T_TOTALSURPLUS SET T_TOTALSURPLUS.SRPLS_HR=(T_TOTALSURPLUS.SRPLS_HR+:NEW.AHR) WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:NEW.VRTMSORT;
ELSIF TMPVAR1=0 THEN
  INSERT INTO T_TOTALSURPLUS(IDS,VRTM_SORT,SRPLS_HR) VALUES(:NEW.IDS,:NEW.VRTMSORT,:NEW.AHR);
END IF;
  ELSIF UPDATING THEN
  IF :NEW.VRTMSORT=:OLD.VRTMSORT THEN
  IF :NEW.AHR <> :OLD.AHR THEN
  UPDATE T_TOTALSURPLUS SET T_TOTALSURPLUS.SRPLS_HR=(T_TOTALSURPLUS.SRPLS_HR-:OLD.AHR+:NEW.AHR) WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:NEW.VRTMSORT;
  END IF;
  ELSIF :NEW.VRTMSORT <> :OLD.VRTMSORT THEN
  SELECT COUNT(*) INTO TMPVAR2 FROM T_TOTALSURPLUS WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:NEW.VRTMSORT;
IF TMPVAR2> 0 THEN
  UPDATE T_TOTALSURPLUS SET T_TOTALSURPLUS.SRPLS_HR=(T_TOTALSURPLUS.SRPLS_HR-:NEW.AHR) WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:OLD.VRTMSORT;
UPDATE T_TOTALSURPLUS SET T_TOTALSURPLUS.SRPLS_HR=(T_TOTALSURPLUS.SRPLS_HR+:NEW.AHR) WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:NEW.VRTMSORT;
ELSIF TMPVAR2=0 THEN
  UPDATE T_TOTALSURPLUS SET T_TOTALSURPLUS.SRPLS_HR=(T_TOTALSURPLUS.SRPLS_HR-:NEW.AHR) WHERE T_TOTALSURPLUS.IDS=:NEW.IDS AND T_TOTALSURPLUS.VRTM_SORT=:OLD.VRTMSORT;         

热点排行