This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL Update from Subquery failing

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone help me understand why the below update from subquery is failing on MySQL 5.6 DB..



MySQL gives the error..



Could it be because hitData_id does not allow nulls and the subquery sometimes returns null? If so how do I modify it to never return null?

Thanks in advance for any help.
 
Ahsan Bagwan
Ranch Hand
Posts: 254
1
Java MySQL Database Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like your schema does not allow nulls for that particular column. The error code is described here: http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html#error_er_bad_null_error .

You might be required to remove the NOT NULL constraint by firing a ALTER TABLE command. Please search for the ALTER statement usage, including defining the constraints on the columns.
 
Supun Lakshan Dissanayake
Ranch Hand
Posts: 135
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you have try to store null value which can't be null.

Check the table definition.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic