Skip to main content

Aktualisierungs-Timestamps


CREATE TABLE table_name (
  id           INTEGER AUTOINCREMENT,
  description  VARCHAR(100) NOT NULL,
  created_at   DATETIME DEFAULT CURRENT TIMESTAMP
  updated_at   DATETIME
);

CREATE TRIGGER tub_TABLE_NAME_TS
BEFORE UPDATE ORDER 1
ON table_name
REFERENCING NEW AS newrec
FOR EACH ROW
BEGIN
  SET newrec.updated_at = CURRENT TIMESTAMP;
END;



Blog