gpt4 book ai didi

oracle - 创建触发器时出错

转载 作者:行者123 更新时间:2023-12-04 05:05:18 25 4
gpt4 key购买 nike

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

 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;

最佳答案

您的触发器格式错误:

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;
/

关于oracle - 创建触发器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15585849/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com