MySQL Forums
Forum List  »  General

Not null field with default value
Posted by: Tom Byars
Date: February 08, 2009 02:34PM

If you add a new record to a table and don't supply a value for a not null field that has a default value, why does MySQL raise an exception stating the field cannot be null? Isn't the idea of a default value that you don't have to supply a value? Is the only way to suppress this exception to make the field a not 'not null' field in which case extra storage is set aside for a possible null value despite the fact a null value will never be assigned?

Options: ReplyQuote

Written By
Not null field with default value
February 08, 2009 02:34PM

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.