MySQL procedure Insert error “Column count doesn't match value count at row 1”
Problem
Error Code: 1136. Column count doesn't match value count at row 1
Normally this error indicates my insert columns have a mismatch values i.e. consider a insert statement as shown below-
insert into table1(col1,col2,col3,col4,col5) values(val1,val2,val4,val5)
We can clearly see that col3 has a missing value in above statement i.e. mismatch of columns and corresponding values. However this was not a case with mine. Every column has corresponding value but still same error.
Cause
Upon close observation of other DB objects, I saw that there was a trigger associated with the table that has missing attributes and hence the same was causing error while inserting values in this table
Solution
Necessary correction done in trigger / deleted partially created trigger and saved it. Now Insert was working fine as expected.
Thank you for your valuable content , Easy to understand and follow. As said, the migration to cloud is very essential for the protection of the database. Zero Cost Cloud Migration services
ReplyDeleteReally very informative and the way you present your information attracts visitors to read a more informative blog from your website. So I look forward to seeing the next update.I hope you continue to have such good posts click here Product Engineering Services | Product Engineering Solutions.
ReplyDelete