Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My insert query is:

INSERT INTO merchant_cfg ( merchant_id , NAME, VALUE ) VALUES ​​( 146 , 'detailed_listing_full.enabled' , 'true' ) ;

I am getting the following result:

1 queries executed, 0 success, 1 errors, 0 warnings

Query: insert into merchant_cfg ( merchant_id , name, value ) values ​​( 146 , 'detailed_listing_full.enabled' , 'true' )

Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '​​( 146 , 'detailed_listing_full.enabled' , 'true' )' at line 1

Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0 sec

Table schema is:

Field Type Null Key Default Extra
----------- ------------ ------ ------ ------- ----------------
id bigint(20) NO PRI (NULL) auto_increment
merchant_id bigint(20) NO MUL (NULL)
name varchar(50) NO (NULL)
value varchar(500) YES (NULL)
Posted
Updated 18-Feb-14 6:21am
v2
Comments
Andrius Leonavicius 18-Feb-14 13:24pm    
Hi,

Could you post CREATE TABLE statement? You need to run the following command to get it:
SHOW CREATE TABLE merchant_cfg\G
Pritam N. Bohra 18-Feb-14 13:27pm    
CREATE TABLE `merchant_cfg` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`merchant_id` bigint(20) NOT NULL,
`name` varchar(50) NOT NULL,
`value` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_u_merchant_cfg` (`merchant_id`,`name`),
KEY `fk_merchant_cfg_mer` (`merchant_id`),
CONSTRAINT `fk_merchant_cfg_mer` FOREIGN KEY (`merchant_id`) REFERENCES `merchant` (`id`)
Andrius Leonavicius 18-Feb-14 13:28pm    
Thank you.
Andrius Leonavicius 18-Feb-14 13:48pm    
This looks good. But strange thing happened. I pasted your insert statement into NOTEPAD++ and it looks like this:

insert into merchant_cfg ( merchant_id , name, value ) values ??( 146 , 'detailed_listing_full.enabled' , 'true' )

It seems that you have some invisible character here, which could cause such error...
Vedat Ozan Oner 18-Feb-14 16:25pm    
you are right.

1 solution

You need to remove noticed invisible character in the INSERT statement, which is after keyword VALUES (please take a look at my comments above).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900