Can I use MySQL functions as the field default values in Table Designer?
updated at
Apply OS: Windows, macOS, Linux
Apply Navicat Product: Navicat for MySQL, Navicat for MariaDB, Navicat Premium
In MySQL, it is not possible to set the default of a field to a function. Please refer to the except below:
With one exception, a DEFAULT value must be a constant; it cannot be a function or an expression. This means, for example, that you cannot set the default for a date column to be the value of a function such as NOW() or CURRENT_DATE. The exception is that you can specify CURRENT_TIMESTAMP as the default for a TIMESTAMP column as of MySQL 4.1.2 or above.
For more details, please refer to: https://dev.mysql.com/doc/refman/8.0/en/create-table.html
Have more questions?
-
Support
-
About Us