If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > inexact error message "Error in SQL syntax"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-28-09, 05:01
oetzi oetzi is offline
Registered User
 
Join Date: Sep 2009
Posts: 2
inexact error message "Error in SQL syntax"

Hello,

I have a curious problem with my SQL Server.
I am developing a web application which uses of course also a database.
Till today I used German names and descriptions and everthing worked fine. Now I decided to translate all tables, etc. into English and one problem occurs:
When executing a INSERT statement, which wasn't changed att all, I get the following error:

Script line: 1 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 'character
VALUES
(1,1,1,'HauDraufWieNix',1,0,1,2,3,4,5,6,'Knecht')' at line 2

Unfortunately the error is not very meaningful, so I want to ask for your help.

Why can changing the names of a table and its attributes lead to such a error?

Could the reason be something with the constraints? This is the only thing I can imagine, that maybe I forgot to translated anything. But I checked it as good as I could and didn't find any obvious mistakes.
Reply With Quote
  #2 (permalink)  
Old 09-28-09, 05:44
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
inexact??? on the contrary, it is very exact

the error message tells you exactly where it happened -- near the word "character"

it seems you named your table "character" but that's a reserved word

either rename it again, or put it in backticks --

INSERT INTO `character` VALUES...

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 09-28-09, 09:10
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Quote:
Originally Posted by r937
either rename it again, or put it in backticks --
FTFY
__________________
George
Twitter | Blog
Reply With Quote
  #4 (permalink)  
Old 09-28-09, 10:38
oetzi oetzi is offline
Registered User
 
Join Date: Sep 2009
Posts: 2
Thanks for the fast help! It was indeed the problem that I did not use the backticks.

However I have still the opinion that "You have an error in your SQL syntax" is not that clear then "duplicated entry" or something like that ;-)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On