Peter Chan
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,mo d_by,delet ed,del_tim e,del_by,s tatus,stor e,waybill_ num,price, remote_cha rge,total_ price,phon e,remark,s tockout_ti me,sign_ti me,sign_st ore,seven_ sign_time, seven_sign _store,ret urn_time,e ng_sms,sms _time,bar_ time,sms_o ut_time1,s ms_out_tim e2,store_d scr,is_isg ) values(642960,str_to_date( '2015-04-0 1 09:47:09','%Y-%m-%d %h:%i:%s'),155744,str_to_d ate('2015- 04-06 02:24:22','%Y-%m-%d %h:%i:%s'),'system',0,'',' ','stockou t','BHKJ07 ','0000000 01300',0,0 ,0,'601274 62','',str _to_date(' 2015-04-01 09:47:35','%Y-%m-%d %h:%i:%s'),str_to_date('20 15-04-04 10:08:00','%Y-%m-%d %h:%i:%s'),'',str_to_date( '2015-04-0 1 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-0 1 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
what is the reason to this problem below?
11:06:50 insert into package (in_time,in_by,mod_time,mo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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).
OR
remove one of the items in the values list (second set of parentheses).
ASKER
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',
ASKER
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.
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-
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-
ASKER