Jump to content

Is It At All Possible To Set A Default Timestamp Value To A Function?


Greywacke

Recommended Posts

hi, i've been struggling with this for a while now, accidentally posted on the PHP forums but intended for here.

ALTER TABLE `8_transactions` UPDATE `timestamp_TransactionEvent` DEFAULT 'CONVERT_TZ(NOW(), "SYSTEM", "+2:00")';

i keep getting the following mysql error, i've tried finding out what the problem is but to no avail.

MySQL said: Documentation#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE `timestamp_TransactionEvent` DEFAULT 'CONVERT_TZ(NOW(), "SYSTEM", "+2:00"' at line 1
Link to comment
Share on other sites

unless of course my syntax is just wrong in overall for updating the default value on a field. *checks mysql documentation*

Link to comment
Share on other sites

well the following code inserts a default value of 0000-00-00 00:00:00

 ALTER TABLE `8_transactions` CHANGE `timestamp_TransactionEvent` `timestamp_TransactionEvent` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NULL DEFAULT 'CONVERT_TZ(CURRENT_TIMESTAMP, "SYSTEM", "+2:00")' COMMENT 'TimeStamp Transaction Event, Current TimeStamp No Keys';

i'd preferrably have this done in the database rather than the code (about 500 insert statements!)how could i go about getting the default value in the field to be SAST instead of the US timezone?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...