SLUG Mailing List Archives
Re: [SLUG] fustrations with mysql (TIMESTAMP)
- To: James Gregory <james@xxxxxxxxxxxx>
- Subject: Re: [SLUG] fustrations with mysql (TIMESTAMP)
- From: mlh@xxxxxxxxxx
- Date: Tue Dec 17 16:34:03 2002
- Cc: Tony Green <tgreen@xxxxxxxxxxx>, Michael Fox <michael@xxxxxxxxxx>, slug@xxxxxxxxxxx
- User-agent: Mutt/126.96.36.199i
On Tue, Dec 17, 2002 at 03:51:03PM +0000, James Gregory wrote:
> If it is going to work, the way to do it will be to not specify that
> field at all in your list of fields to insert into. It's supposed to
> operate like a default value essentially. If you specify something else
> it will use that. both NULL and the empty string are "something".
If I'm not completely mistaken, NULL is as close to nothing
that you're going to get. The SQL standard doesn't really
allow missing values -- if you leave a value out of an insert
statement you will get NULL values, a user specified default,
or an error.
What this means for MySQL ... I dunno.
Also FWIW, putting things like CURRENT_TIME in tables is
fairly brittle -- think of what happens at daylight saving
time or when the time on your pc goes haywire. Bad things
happen to your data.
What you're usually after is a "guaranteed to be greater"
value. With postgresql/oracle you'd use nextval().
Again, I'm a little ignorant of mysql. Does it have this?