Why am i returning an INVALID identifier when trying to COMPILE this TRIGGER?

丶灬走出姿态 提交于 2019-12-11 17:36:31

问题


So I am trying to compile this trigger that prints some lines as outputs ( have the variables declared because i will be building onto this trigger using these variables later on). There's an existing trigger in the same database that does the same exact thing with a different table passing the same data, but my trigger seems to throw an error saying that 'new.PROCESSED is an invalid identifier'. What am I doing wrong? I may just not know what is fully going on here in my code... (thanks in advance!) value_value_id_se and cALCULATION_VALUE_CALCULATI329 are both functions in the system...

create or replace TRIGGER CAL_VAL
    AFTER INSERT
    ON XML_HOURS_LOAD
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    WHEN (
    NEW.processed = 'N'
          )
DECLARE 
    Value_ID Number;
    pValue_ID Number;
    pCalculation_ID NUMBER;
    Calculation_ID Number;
    Calculation_Value_ID Number;
    p_Entity_Address_ID Varchar2(50);
    New_Value_ID Number;
    New_Calculation_ID Number;
    New_Calculation_Value_ID Number;

BEGIN

    Value_ID := value_value_id_seq.NEXTVAL;
    New_Value_ID := Value_id ;
    Calculation_Value_ID:=CALCULATION_VALUE_CALCULATI329.NEXTVAL;
    calculation_id := Calculation_Calculation_ID_SEQ.NEXTVAL;
    p_Entity_Address_ID := :New.EIA_ID_TX;

    DBMS_OUTPUT.PUT_LINE(Get_energy_product_id(:NEW.Product_Name_Cd));
    DBMS_OUTPUT.PUT_LINE(Get_Data_Source_Id(:NEW.Data_Source_Tx));
    DBMS_OUTPUT.PUT_LINE(Get_Supply_Type_Id(:NEW.Supply_Type_Tx));
    DBMS_OUTPUT.PUT_LINE(Get_State_CD(Get_entity_Id(p_Entity_Address_ID)));     
    DBMS_OUTPUT.PUT_LINE(Get_Entity_Address_ID(Get_Entity_ID(p_Entity_Address_ID)));
    DBMS_OUTPUT.PUT_LINE('Value_ID' || Value_ID);
END;

来源:https://stackoverflow.com/questions/48915668/why-am-i-returning-an-invalid-identifier-when-trying-to-compile-this-trigger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!