[NTLUG:Discuss] OT: MySQL date field defalt
Jack Snodgrass
jack at jacksnodgrass.com
Sun Apr 18 19:23:58 CDT 2004
With mysql, defaults have to be static values...
not functions like now() or curent_date().
jack
On Sun, 2004-04-18 at 18:19, Steve Southwell wrote:
> I'm sort of a newbie at using MySQL, and I'm converting an app from
> Progress DB to MySQL.
>
> I've got almost everything in the schema to translate properly, but the
> one thing I've found that doesn't seem to have a counterpart in MySQL is
> the ability for a field with Type = "Date" to default to the current
> date upon record creation.
>
> I'm aware that the timestamp type will always be the current date on
> INSERTs and UPDATEs unless explicitly set, but that's not what I want -
> I'd like to have the field only default to the current date on the
> initial INSERT of the record.
>
> Anyone know how to do this, or is it just impossible with MySQL, and
> I'll have to start requiring the application to set the default date?
>
> Much thanks,
More information about the Discuss
mailing list