MySQL Forums
Forum List  »  General

Re: Not null field with default value
Posted by: Tom Byars
Date: February 11, 2009 06:25AM

I should've said the default for a short was -32768 not 32768 (I've edited the post). I think all bits on is used for nulls.

I've now found that if I allow the field to have a null value and leave it blank it now gets alloted the default value but I think that must be down to the MyDAC component I'm using inside cppbuilder. That makes it even weirder - try to assign a null value to a not null field with a default value and you get an exception but try to assign a null value to a field that allows null values and you end up with the default value. I despair.

On a similar subject, you can alot an enum field a value of 0 (which appears to give it a value of '') but you cannot give it a default value of '' or 0 (unless '' is an enum value. You can give a set a default value of '' (which I assume corresponds to numeric value 0).

Options: ReplyQuote


Subject
Written By
Posted
February 08, 2009 02:34PM
Re: Not null field with default value
February 11, 2009 06:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.