Dear Chugh,

> Can we define sysdate or curdate as default date for a column of
> datatype 'date' while creating a table?


The question is ambiguous:

- if a table is created with a column defined to be a TIMESTAMP data type,
then every time a row is INSERTed or UPDATEd, the current date will be
entered into the field (a two-edged sword!).

- if you want to "define" the date/time under which MySQL is running, eg run
it as if the server was in London instead of India, then the way to do that
is to run the whole serverPC with such a system clock setting.

- if you want the table's creation date/time to be the default value for a
particular column, then I think you will have to hard-code that as a literal
value into the column definition within CREATE TABLE (I don't think it is
possible to ask MySQL to evaluate and plug in the time value for you)

Have you studied the manual?
Regards,
=dn



---------------------------------------------------------------------
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