Shawn,
Monday, July 15, 2002, 5:51:01 PM, you wrote:

SP> I'm new to this list and MySQL, so I hope this question isn't too 
SP> rudimentary.

SP> In SQL Server I was able to create a datetime field that used the default 
SP> getdate() function so that I woudl get timestamps on all created rows 
SP> automatically, like:
SP> create table mytable (
SP>    createddate datetime not null default getdate()
SP> )

SP> I'm having trouble doing this in MySQL, but it keeps complaining.  All I 
SP> have to work on is:
SP> create table mytable (
SP>    createddate datetime not null default now()
SP> )

SP> But it doesn't like now().  I can't find anything else to try in the MySQL 
SP> docs.

You can't use functions for the default values.
If you want to specify current date and time as a default value, take a
look at TIMESTAMP column type:
     http://www.mysql.com/doc/D/A/DATETIME.html




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to