Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Problem to query

Hi,
what is the reason to this problem below?

11:06:50      insert into package (in_time,in_by,mod_time,mod_by,deleted,del_time,del_by,status,store,waybill_num,price,remote_charge,total_price,phone,remark,stockout_time,sign_time,sign_store,seven_sign_time,seven_sign_store,return_time,eng_sms,sms_time,bar_time,sms_out_time1,sms_out_time2,store_dscr,is_isg) values(642960,str_to_date('2015-04-01 09:47:09','%Y-%m-%d %h:%i:%s'),155744,str_to_date('2015-04-06 02:24:22','%Y-%m-%d %h:%i:%s'),'system',0,'','','stockout','BHKJ07','000000001300',0,0,0,'60127462','',str_to_date('2015-04-01 09:47:35','%Y-%m-%d %h:%i:%s'),str_to_date('2015-04-04 10:08:00','%Y-%m-%d %h:%i:%s'),'',str_to_date('2015-04-01 23:49:25','%Y-%m-%d %h:%i:%s'),'0336','',0,str_to_date('2015-04-01 09:47:35','%Y-%m-%d %h:%i:%s'),'',str_to_date('2015-04-01 18:55:28','%Y-%m-%d %h:%i:%s'),'','852J1007',0)      Error Code: 1136. Column count doesn't match value count at row 1      0.062 sec
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Peter Chan

ASKER

Sorry, I don't know exactly  what the reason is.
You either need to add one more column name in the list inside the first set of parentheses
OR
remove one of the items in the values list (second set of parentheses).
here are the columns' Data type
  `in_time` datetime default NULL,
  `in_by` varchar(45) default NULL,
  `mod_time` datetime default NULL,
  `mod_by` varchar(45) default NULL,
  `deleted` varchar(45) default '0',
  `del_time` datetime default NULL,
  `del_by` varchar(45) default NULL,
  `status` varchar(45) default NULL,
  `store` varchar(45) default NULL,
  `waybill_num` varchar(45) default NULL,
  `price` varchar(45) default NULL,
  `remote_charge` varchar(45) default NULL,
  `total_price` varchar(45) default NULL,
  `phone` varchar(45) default NULL,
  `remark` varchar(500) default NULL,
  `stockout_time` datetime default NULL,
  `sign_time` datetime default NULL,
  `sign_store` varchar(45) default NULL,
  `seven_sign_time` datetime default NULL,
  `seven_sign_store` varchar(45) default NULL,
  `return_time` datetime default NULL,
  `eng_sms` varchar(1) default '0',
  `sms_time` datetime default NULL,
  `bar_time` varchar(45) default NULL,
  `sms_out_time1` datetime default NULL,
  `sms_out_time2` datetime default NULL,
  `store_dscr` varchar(45) default NULL,
  `is_isg` int(11) default '0',

Open in new window

which is the item to remove?
The order of the values in "values" has to match the order of the columns in the first set of parentheses.
For example in_time is a date field, but the first value is an integer. Correct this.
in_by is a character field, but the second value is a date. Correct this.
Keep doing this for every column.
@HuaMinChen

not too sure why you always rewarding the experts with a B or even C. You should reconsider to give a fair grade for the experts. if not the experts may feel that you not appreciate their helps and in fact you may no need their helps.

How do I accept a comment as my solution?
http://support.experts-exchange.com/customer/portal/articles/608621-how-do-i-accept-a-comment-as-my-solution-