I've found in general the default values are only applied if you attempt to
insert without even mentioning the things that you want to take on default
values. This is pretty much what James says.

eg (this is a table of engineering drawing issues):
  INSERT INTO dwg_issue (id, dwgissue) VALUES (NULL, "A01");

In this case I'm making a new record and only specifying one value. All
other column values in this record (if it has any) should take on default
values, if specified as such when the table was created.
BUT! Timestamp may be a special case.

Cheers,

Jill.

-- 
Jill Rowling, System Administrator
Eng. Systems Dept, Aristocrat Technologies Australia
Level 2, 55 Mentmore Ave Rosebery NSW 2018
Phone: (02) 9697-4484 Fax: (02) 9663-1412 Email: [EMAIL PROTECTED]
 


-----Original Message-----
From: James Gregory [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 18 December 2002 2:51
To: Tony Green
Cc: Michael Fox; [EMAIL PROTECTED]
Subject: Re: [SLUG] fustrations with mysql (TIMESTAMP)


On Tue, 2002-12-17 at 04:41, Tony Green wrote:
> On Tue, 2002-12-17 at 15:32, Michael Fox wrote:
> > 
> > Ahuh, and I've read it along with many other pages from /doc/en/
> > 
> > As I said, still having problems.
> > 
> > Might just drop this field, and figure it out another time. At the end
of the 
> > day I am just writing something to learn from. Since I've wanted to do
some 
> > more mysql/php mucking about.
> 
> 
> Your using 'INSERT INTO blah VALUES( 'blah','blah','');' and it doesn't
> work.  Try 'INSERT INTO blah VALUES( 'blah','blah',NULL);' and see if
> you get any better results.

I've also had issues with it, but if you want it to try it then
specifying a value for it won't let it set it itself.

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

James.


-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

----------------------------------------------------------------------
IMPORTANT NOTICES
This email (including any documents referred to in, or attached, to this
email) may contain information that is personal, confidential or the subject
of copyright or other proprietary rights in favour of Aristocrat, its
affiliates or third parties. This email is intended only for the named
addressee. Any privacy, confidence, copyright or other proprietary rights in
favour of Aristocrat, its affiliates or third parties, is not lost because
this email was sent to you by mistake.

If you received this email by mistake you should: (i) not copy, disclose,
distribute or otherwise use it, or its contents, without the consent of
Aristocrat or the owner of the relevant rights; (ii) let us know of the
mistake by reply email or by telephone (+61 2 9413 6300); and (iii) delete
it from your system and destroy all copies.

Any personal information contained in this email must be handled in
accordance with applicable privacy laws.

Electronic and internet communications can be interfered with or affected by
viruses and other defects. As a result, such communications may not be
successfully received or, if received, may cause interference with the
integrity of receiving, processing or related systems (including hardware,
software and data or information on, or using, that hardware or software).
Aristocrat gives no assurances in relation to these matters.

If you have any doubts about the veracity or integrity of any electronic
communication we appear to have sent you, please call +61 2 9413 6300 for
clarification.
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to