Create trigger to insert into another table

前端 未结 4 1535
一向
一向 2021-01-26 08:09

I have some problem executing the trigger below:

CREATE OR REPLACE TRIGGER AFTERINSERTCREATEBILL
AFTER INSERT
ON READING
FOR EACH ROW 

DECLARE

varReadNo   Int;         


        
4条回答
  •  北海茫月
    2021-01-26 08:49

    Add exception handling in your trigger and see what is happening, by doing it would be easy for you to track the exceptions.

    CREATE OR REPLACE TRIGGER AFTERINSERTCREATEBILL
    AFTER INSERT
    ON READING
    FOR EACH ROW 
    
    DECLARE
    
      varCustID   Varchar(10);
    
    BEGIN 
    
      -- your code
    
    EXCEPTION
        WHEN NO_DATA_FOUND
        THEN
            DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQLERRM(-20299)));
        WHEN OTHERS THEN
        DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQLERRM(-20298)));
    
    END;
    

提交回复
热议问题