• When I go to add add a new record, the timestamp defined field that is defaulted with “current_timestamp” shows the Literal “Current_timestamp”. If the field is not modified (not entered) and the record is submitted to be added, I get the date “-001-11-30 00:00” not the current value of Current_timestamp. When I select the field but don’t enter any value and then submit the add, I get the correct timestamp.

    Taking this one step farther: how do you update this field with the date that the record was last updated (I remember a parameter “on update” from my old Oracle days, do you have this option?

Viewing 1 replies (of 1 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @carlrgates,

    You cannot use current_timestamp as a default value in the Data Designer or a Project Template. It can only be used in SQL like:

    ALTER TABLE t
    MODIFY COLUMN c TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    ON UPDATE CURRENT_TIMESTAMP;

    From my old Oracle days as well! 🙂

    You can execute this command directly from the Data Explorer button Import data/Execute script(s). Just make sure your SQl statement end with a ; directly followed by a new line. You can also enter multiple SQL statement in one script.

    Does this help?
    Peter

Viewing 1 replies (of 1 total)

The topic ‘Default Value – Current_timestamp’ is closed to new replies.