tags:

views:

171

answers:

2

If I try this statement:

INSERT INTO TerminalEventChild (id,stringValue) VALUES 
(64,'version123|');

MySQL fail with :

Error: 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 ''version123' at line 1
SQLState:  42000
ErrorCode: 1064

If I remove the | character, everything works fine. Any idea?

+3  A: 

On my machine, this works fine:

CREATE TABLE TerminalEventChild (id INT, stringValue VARCHAR(200));

INSERT INTO TerminalEventChild (id,stringValue) VALUES
(64,'version123|');

Probably, your client treats the pipe character specially.

What client do you use?

Quassnoi
So, what was the problem ?
nos
Right, I just tried with the mysql command line and it worked fine. I am using SQuirreLSQL. I will check with them. Thanks you!
Manuel Darveau
I can also confirm this works. I tried it using the mysql cli (5.1.42) on a Linux box.
John Himmelman
+1  A: 

I don't suppose it's a varchar(10) field?

Jim Kiley