|
womble -> MySQL syntax errors (11/30/2006 7:12:54)
|
I'm having problems with an SQL script that's throwing up MySQL "ERROR 1064" errors (using the MySQL monitor) - I've checked the reference manual and googled, and it seems to be something to do with using reserved words (with I'm not) - either that or it doesn't like the quote marks I'm using around field names. ` it likes (can't find that on my keyboard though, I'm C&Ping them from a pdf <edit>found it now!</edit>), ' it doesn't. I've tried with and without quotes around them, taking out the comments I've got in the script incase it was the comment syntax I'd messed up (that didn't make any difference), and just about every variation I can think of, and it still doesn't like it.
DROP TABLE IF EXISTS `TaxRate`;
CREATE TABLE `TaxRate` (
`Rate` decimal(2,2) UNSIGNED NOT NULL default 'Not defined',
PRIMARY KEY(`Rate`)
) TYPE = MyISAM;
The above is the only table it'll accept. All the others, which are set up more or less the same but with more fields, I get these "Error 1064" errors with. For example, in the above script, if I replace the 3rd line with: `FieldName` varchar(150) UNSIGNED NOT NULL default 'Not defined', ...I get the same error. I've tried messing around with the quotes, capitalising the data type, lower-case data type (whichever data type I try I'm still getting these errors though I did get INT and TINYINT to work once). I've got the comma at the end of each phrase and semi-colon at the end of the statement... I'm either getting something fundamentally wrong here, or the MySQL server just doesn't like me! I can't post the whole script because it's for an assignment for a course I'm doing, but has anyone got any ideas as to what could be causing this?
|
|
|
|