![]() |
MySql Error
Hello All,
I cant seem to find any problems with this code, but MySQl throws a fit when I run it (lol) :
--Invoice Database Details: MySql 5.027 Errors: ERROR 1064 (42000): 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 'number(6,2))' at line 6 ERROR 1064 (42000): 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 'NULL,descriptionID char(4) REFERENCES description (descriptionID) NOT NUL' at line 7 ERROR 1064 (42000): 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 'NOT NULL, product varchar2(1000) NOT NULL, price number(6,2) ' at line 3 |
What is a number() data type? I've never heard of it
|
1 problem fixed
Thanks, your right, apparently number isn't a data type (although it is in Oracle). And I changed the varchar2 cols to text
but i still get the following errors: ERROR 1064 (42000): 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 'NULL, descriptionID char(4) REFERENCES description (descriptionID) NOT NUL' at line 7 ERROR 1064 (42000): 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 'NOT NULL, product TEXT NOT NULL, price DECIMAL(6,2) ' at line 3 changed code: :
--Invoice Database |
Any thoughts anybody ? Thanks
|
:
drop table description;NOT NULL goes in front of CHECK or REFERENCES - this will help you : http://dev.mysql.com/doc/refman/5.0/...ate-table.html |
Thanks, i got rid of one of the errors, there is still one left though
new code: :
--Invoice Database Error ERROR 1064 (42000): 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 'totalDue DECIMAL(6,2) NOT NULL, invComments TEXT)' at line 12 Query OK, 0 rows affected (0.02 sec) |
If you copy paste my exact code, you'll have no error. Also, how about looking at the error yourself ? You're missing a comma at line 11
|
Oh I cant thank you enough Xavier. Really appreciate it. Sufficed to say i got a clean run
|
No problem, but it would help you more if you have the patience to check out the documentation. Best of luck to you
|
| All times are GMT -5. The time now is 5:03 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC