Event Type-
DDL_COMMAND_START
DDL_COMMAND_END
This is example for creating an Event Trigger and logging DDL_COMMAND_START
events.
CREATE TABLE TAB_EVENT_LOGS(
DATE_TIME TIMESTAMP,
EVENT_NAME TEXT,
REMARKS TEXT
);
CREATE OR REPLACE FUNCTION FN_LOG_EVENT()
RETURNS EVENT_TRIGGER
LANGUAGE SQL
AS
$main$
INSERT INTO TAB_EVENT_LOGS(DATE_TIME,EVENT_NAME,REMARKS)
VALUES(NOW(),TG_TAG,'Event Logging');
$main$;
CREATE EVENT TRIGGER TRG_LOG_EVENT ON DDL_COMMAND_START
EXECUTE PROCEDURE FN_LOG_EVENT();