|
Home > Archive > MySQL Server Forum > December 2005 > i know this isn't the place for feature requests, but...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
i know this isn't the place for feature requests, but...
|
|
| Matthew Crouch 2005-12-16, 9:23 am |
| 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?
| |
| Jonathan 2005-12-16, 11:23 am |
| 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
| |
| Bill Karwin 2005-12-16, 1:23 pm |
| "Matthew Crouch" <matthew. crouch@spamlessveriz
on.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.
|
|
|
|
|