1

The following SQL Query:

CREATE TABLE IF NOT EXISTS `dsgdsgdsg` (`combo` varchar(255) NOT NULL, `dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`combo`))

Returns:
SQL logic error or missing database near "ON": syntax error

Which seems to be related to "ON UPDATE", why is that? Is On Update not supported by SQLite? if so, is there an alternative (So that when I update using REPLACE INTO, I wont need to supply a new timestamp it just updates).

HoneyBadger
  • 14,750
  • 3
  • 34
  • 48
Ma Dude
  • 477
  • 1
  • 5
  • 17

1 Answers1

1

This is okey for a MySQL. However it's different in SQLite, use a trigger instead. Someone had the same problem and was solved here on update current_timestamp with SQLite

mapu77
  • 26
  • 4