I am currently trying to create a trigger in postgresql
to perform an insert in a table. But when executing the sentence the result throws:
ERROR: syntax error at or near "BEGIN" LINE 4: BEGIN
CREATE TRIGGER TRG_INS_DOCUMETTYPE
AFTER INSERT ON DOCUMENTTYPE
FOR EACH ROW
BEGIN
INSERT INTO AUD_DOCUMENTTYPE (
DOCT_ID,
DOCT_NAME,
DOCT_REGISTERBY,
DOCT_REGISTERDATE,
DOCT_OPERATION
) VALUES (
:NEW.DOCT_ID,
:NEW.DOCT_NAME,
:NEW.DOCT_REGISTERBY,
:NEW.DOCT_REGISTERDATE,
'INSERT'
);
END;
What have I got wrong?