0

I am ran into a weird problem this particular query is not working

insert into `timesheet` 
    (`type`,`app_id`,`app_name`,`app_title`,
     `app_path`,`timestamp_start`,`timestamp_end`,`duration`,
     `user_id`,`matter_id`,`updated_by_user_id`,`timestamp_create`,
     `source`,`user_rate`,`cost`,`description`,
     `location_name`,`conflict`,`suggestion`) 
Values 
    ('PLUGIN', '5232', 'oMgqTrYiZVQp.exe', 'qZXhgWtnwvQq',
     'k', '2016-05-06T18:21:29.000Z', '2016-05-18 19:29:50.000', '1021101',
     '4', '1', '-1', '2019-06-15T01:13:34.000Z',
     NULL, '15000', '4254.5875', NULL,
     NULL, '0', NULL)

WHat I was doing is running man this query with different values, rest are working fine, but for this particular query, it throws the error.

Error Code: 1136. Column count doesn't match value count at row 1

Can you pelase let me know what I am doing wrong or any hint would be appreciated so that i can debug it

1
  • Hi guys. There was some issue in the table triggers and because of a if statement, it failed. Is there anyway to figure out where the error originated in mysql? Commented Aug 14, 2019 at 6:14

1 Answer 1

0

Your error is telling you that the amount of columns you said you'd fill does not match the amount of columns you actually are giving data for. Make sure the amount of columns specified after timesheet matches the amount of columns filled after Values.

Additionally you may want to check if the source, description, location_name and suggestion columns allow NULLS. You can also test if it works if you replace the NULL values with dummy values (like an empty string or a 0).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.