Posts

Showing posts from January, 2020

MySQL procedure Insert error “Column count doesn't match value count at row 1”

Image
Recently I have came across a strange situation in MySQL Database. I have created a MySQL procedure that uses insert statement to insert values in database table. However, It was working fine previously but all of a sudden it stopped working with below error code- 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 Nec