I am trying to create a trigger named transaction_type_af_insert that is triggered whenever a new record is inserted into ransaction_type table. This trigger will insert the new type and action into the table transaction_type_log_history after the insertion of transaction type details. The action name in the affected log table transaction_type_log_history is 'After_Insert_transaction_type'.
But facing below error:
Warning: Trigger created with compilation errors.
insert into transaction_type(id,type)values(22,'Credit Card')
*
ERROR at line 1:
ORA-04098: trigger 'P12097.TRANSACTION_TYPE_AF_INSERT' is invalid and failed
re-validation
Please help me resolve the issue
CREATE TRIGGER transaction_type_af_insert
AFTER INSERT
ON transaction_type FOR EACH ROW
DECLARE
type varchar(30)
action varchar(30)
BEGIN
UPDATE transaction_type_log_history
SET action = 'After_Insert_transaction_type'
WHERE transaction_type.id = transaction_type_log_history.id;
END;