470,591 Members | 1,484 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

i know this isn't the place for feature requests, but...

i figured one of the gurus in here could tell me if/how this is possible
already:

i like simple, singular table names. For example "user". I bet you know
the problem already: USER is a keyword, and when I query this table i
get errors. Is there a way to make mysql's keyword-watching
case-sensitive? so it would leave "user" alone but catch errors on
"USER". Good SQL writing means capitalizing keywords yourself...

should i just get accustomed to table prefixes? i think they're ugly;
what do you think?
Dec 16 '05 #1
2 1100
Matthew Crouch wrote:
i figured one of the gurus in here could tell me if/how this is possible
already:

i like simple, singular table names. For example "user". I bet you know
the problem already: USER is a keyword, and when I query this table i
get errors. Is there a way to make mysql's keyword-watching
case-sensitive? so it would leave "user" alone but catch errors on
"USER". Good SQL writing means capitalizing keywords yourself...

should i just get accustomed to table prefixes? i think they're ugly;
what do you think?


As you would probably have more users in one table you could call it
'users' instead of 'user' ;-) or use a different word as customer for
instance, this way you don't need to use prefixes...

Jonathan
Dec 16 '05 #2
"Matthew Crouch" <ma************@spamlessverizon.net> wrote in message
news:INzof.24529$OK6.14328@trnddc03...
i like simple, singular table names. For example "user". I bet you know
the problem already: USER is a keyword, and when I query this table i get
errors. Is there a way to make mysql's keyword-watching case-sensitive?
No -- SQL keywords are always case-insensitive. As for table names, they
are case-insensitive on Windows and case-sensitive on UNIX/Linux. And I
think there's an option for the MySQL server that can override this, but
that's besides the point of your question.
should i just get accustomed to table prefixes? i think they're ugly; what
do you think?


I don't think identifier prefixes are necessarily ugly. But that's a matter
of taste.

Anyway, you can use a table name that conflicts with a reserved word by
enclosing it in back-ticks:

SELECT * FROM `USER`;

(FWIW, standard SQL uses double-quotes for this purpose.)

Regards,
Bill K.
Dec 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

72 posts views Thread by The Plankmeister | last post: by
7 posts views Thread by Neo | last post: by
30 posts views Thread by Raymond Hettinger | last post: by
19 posts views Thread by George Sakkis | last post: by
1 post views Thread by Brennan Stehling | last post: by
10 posts views Thread by Conrad Lender | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.