I don’t know how to create AFTER INSERT TRIGGER with the condition Table_1.Table_2_ID = Table_2.ID .
CREATE OR REPLACE TRIGGER Table_2_TRG
AFTER INSERT
ON Table_1
FOR EACH ROW
BEGIN
UPDATE Table_2
SET Col1 = '1'
FROM (SELECT Table_2_ID FROM Table_1)
WHERE Table_1.Table_2_ID = Table_2.ID;
END;
It is needed to change record’s value in the Table_2 AFTER INSERT a record in the Table_1 with the similar ID (Table_2_ID in the Table_1 and ID in the Table_2 are identical).
Col1 in the Table_2 has type VARCHAR2.
I have this code, but after running statement there is an error:
“2/5 PL/SQL: SQL Statement ignored
4/5 PL/SQL: ORA-00933: SQL command not properly ended”