MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 16th, 2003, 06:19 PM
brettr1974's Avatar
brettr1974 brettr1974 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 142 brettr1974 User rank is Private First Class (20 - 50 Reputation Level)brettr1974 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 15 m 36 sec
Reputation Power: 6
Table called 'ORDER'...

Im trying to write some queries to a database I didnt design and Ive found that they have created a table with the name 'ORDER'.

Ive no idea why they would do this but they have, so my question is how the hell am I going to run queries on it.

When i use say 'select * from order' it says that Ive a syntax error. And this is caused by the keyword order.

Any ideas ?

this table sits in a ms-access database which Im trying to query to update a mysql database.

Reply With Quote
  #2  
Old November 16th, 2003, 07:02 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 23 m 12 sec
Reputation Power: 765
Try putting [ ] around the column name. For MS db servers this will let you use non-standard column names. Select * from [ORDER] should work for table names too.

Reply With Quote
  #3  
Old November 16th, 2003, 07:02 PM
aaron.martone's Avatar
aaron.martone aaron.martone is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Central Florida
Posts: 76 aaron.martone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via ICQ to aaron.martone
Valid SQL Code is:

SELECT *
FROM table_name
WHERE parameters

Some SQL requires you to terminate with a semicolon (;) at the end of the statement though.

Reply With Quote
  #4  
Old November 16th, 2003, 07:07 PM
brettr1974's Avatar
brettr1974 brettr1974 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 142 brettr1974 User rank is Private First Class (20 - 50 Reputation Level)brettr1974 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 h 15 m 36 sec
Reputation Power: 6
putting [] round the table name like [order] let me prepare the statement. thanks for that.

Although this worked it showed me another problem, maybe my documentation is wrong on this database.
So i wanted to list all tables in the database by using :
show tables;
This also errors. Where could I find valid sql for a ms access database.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Table called 'ORDER'...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway