2

我创建了一个如下所示的触发器。但它向我显示了一个错误。

 2/30    PLS-00103: Encountered the symbol "=" when expecting one of the following:
          := ; not null default character

谁能帮我解决这个问题?提前致谢

CREATE OR REPLACE TRIGGER ADRAKLIVE.TRG_HELPDESK
AFTER UPDATE
OF STATUS
ON ADRAKLIVE.TBL_SERVICEREPORT 
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
     declare ts varchar2(10) = :'YES';
 UPDATE tbl_ithelpdesk
       SET it_closed  =: ts
     WHERE call_no = :NEW.call_no;
END;
4

2 回答 2

2

您的触发器格式错误:

CREATE OR REPLACE TRIGGER TRG_HELPDESK
AFTER UPDATE
OF STATUS
ON TBL_SERVICEREPORT 
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
declare
  ts varchar2(10) := 'YES';
BEGIN
 UPDATE tbl_ithelpdesk
       SET it_closed  = ts
     WHERE call_no = :NEW.call_no;
END;
/
于 2013-03-23T10:58:56.870 回答
1

将触发器更改为:

CREATE OR REPLACE TRIGGER ADRAKLIVE.TRG_HELPDESK
AFTER UPDATE
OF STATUS
ON ADRAKLIVE.TBL_SERVICEREPORT 
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
   ts varchar2(10);
BEGIN
 ts := 'YES';
 UPDATE tbl_ithelpdesk
       SET it_closed  =: ts
     WHERE call_no = :NEW.call_no;
END;
于 2013-03-23T10:51:46.497 回答