Why am I getting a “no default value” error on a separate column when using “INSERT INTO” on a different column in MySQL Database?

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

Some columns in a table may require a value, that is, null values are not allowed. If so, a default value can be specified for the column when the table is created. If you insert a new row in the table without specifying a value for that column, the default value will be used. If no such value was specified when the tables was created you will get the error you got. You either need to specifiy a default value for the column when creating the table, or provide one when inserting a new row.