So, if any of you run into this, renaming the table to something like "customer_order" should work fine.
Sunday, February 28, 2010
order is a reserved word in SQL
I'm not sure if this was ever mentioned in class or anything, but "order" is a reserved word in SQL, so you cannot (in MySQL, anyway) create a table named "order". The error I was getting when I was attempting to do this was not very clear, so it took a while to realize that this was the problem.
Subscribe to:
Post Comments (Atom)
That's interesting, because I created a table in MySQL that's called "order" and it works just fine for me.
ReplyDeleteyeah I had to call mine orders.
ReplyDeleteIt is possible to create a table named order. If you simply run command such as
ReplyDeletecreate table order (.......);
you will run into exception.
However putting order within quotes should work. Note that this is not a single quote though. If you want to try it yourself, I would recommend you to copy and paste it.
create table `order` (.........);