Hi,

Firstly, thanks for the reply.

I'm aware that MySQL requires that default values be constants without
reference to expressions that need to be evaluated and the fields in
question will never be updated - it's a set-once thing.

The reason I asked is due to the information in the MySQL manual stating
they were related. The only reason I didn't use TIMESTAMP from the
outset is because we don't want the time part of the field. I think we
can spare the extra few bytes per row though, so I'll probably use
TIMESTAMP fields anyway.

Thanks again!

Regards,

Chris

On Sun, 2004-01-04 at 11:13, Matt W wrote:
> Hi Chris,
> 
> Nope, DEFAULT values have to be constants; no functions or anything.
> :-/
> 
> What are you trying to do?  And what's wrong with using TIMESTAMP since
> you want a default of NOW()?  If it's because you don't want it update
> when you UPDATE the row, you can just set it to its current value, if
> you weren't aware of that.
> 
> 
> Matt
> 
> 
> ----- Original Message -----
> From: "Chris Nolan"
> Sent: Saturday, January 03, 2004 10:34 AM
> Subject: Default DATE field values
> 
> 
> > Hi all,
> >
> > Upon reading the funky manual, I have discovered the following things:
> >
> > 1. TIMESTAMP fields can be set so that their default value is NOW().
> > 2. DATE and TIMESTAMP fields are related.
> >
> > Given the two above facts, is there a way to set DATE columns so the
> > default value is NOW()? My playing around seems to have not produced
> any
> > fruitful results.
> >
> > Regards,
> >
> > Chris
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to