创建触发器时出现 ORA-06512
ORA-06512 when creating a trigger
我正在尝试为现有 table 创建触发器:
CREATE OR REPLACE EDITIONABLE TRIGGER "AD_EDGE_FORECAST_PRODUCTS"
AFTER DELETE ON "EDGE_FORECAST_PRODUCTS" FOR EACH ROW
BEGIN
UPDATE EDGE_FORECAST
SET PRODUCTS_VCE = CASE WHEN PRODUCTS_VCE IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_VCE, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_VCP = CASE WHEN PRODUCTS_VCP IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_VCP, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_GRC = CASE WHEN PRODUCTS_GRC IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_GRC, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_PLM = CASE WHEN PRODUCTS_PLM IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_PLM, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_MDM = CASE WHEN PRODUCTS_MDM IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_MDM, :NEW.PRODUCT, ''), '::', ':') END
WHERE ID = :NEW.ID
END;
但是当我尝试 运行 这段代码时,我得到以下结果:
ORA-24344: success with compilation error
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_200100", line 581
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1658
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_200100", line 567
ORA-06512: at "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", line 2127
这里有什么问题?
我是不是忘记了一些关于语法的东西basic/stupid?
SQL 语句末尾的分号(即 "WHERE ID = :NEW.ID;" )
我正在尝试为现有 table 创建触发器:
CREATE OR REPLACE EDITIONABLE TRIGGER "AD_EDGE_FORECAST_PRODUCTS"
AFTER DELETE ON "EDGE_FORECAST_PRODUCTS" FOR EACH ROW
BEGIN
UPDATE EDGE_FORECAST
SET PRODUCTS_VCE = CASE WHEN PRODUCTS_VCE IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_VCE, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_VCP = CASE WHEN PRODUCTS_VCP IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_VCP, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_GRC = CASE WHEN PRODUCTS_GRC IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_GRC, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_PLM = CASE WHEN PRODUCTS_PLM IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_PLM, :NEW.PRODUCT, ''), '::', ':') END,
PRODUCTS_MDM = CASE WHEN PRODUCTS_MDM IS NULL
THEN NULL
ELSE REPLACE(REPLACE(PRODUCTS_MDM, :NEW.PRODUCT, ''), '::', ':') END
WHERE ID = :NEW.ID
END;
但是当我尝试 运行 这段代码时,我得到以下结果:
ORA-24344: success with compilation error
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_200100", line 581
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1658
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_200100", line 567
ORA-06512: at "APEX_200100.WWV_FLOW_DYNAMIC_EXEC", line 2127
这里有什么问题?
我是不是忘记了一些关于语法的东西basic/stupid?
SQL 语句末尾的分号(即 "WHERE ID = :NEW.ID;" )