Re: Complicated database problem





Bill Karwin <bill@xxxxxxxxxx> wrote:


>> For starters, FROM and TO are reserved words in SQL, so *_DO NOT_* use
>> them as your column names.

>That's a bit too strict. Many modern RDBMS products support quoted
>identifiers, specifically so you can use reserved words as table names,
>column names, etc. (or identifiers with international characters,
>whitespace, and so on).

> SELECT * FROM "TABLE"
>MySQL unfortunately differs from the standard and uses backticks:
> SELECT * FROM `TABLE`


And here, you present a perfect example of why not to use reserved
words. In many systems, I'll grant (oops - reserved word there) you
say that reserved words can be escaped, but really, is it worth the
bother? Just train programmers and DBA's not to use them, full stop!


You also point out another problem, "Many...", now, to my mind, many
is not "All", therefore potential problems are again looming in the
mist, just waiting to catch the inexperienced programmer/DBA.


Golden rule - do *_NOT_* under any circumstances whatsoever use
reserved words - it really will make life easier for you ("do I
escape/quote this damn thing or not?") and most especially for those
who come after you.

I've worked with systems which did this, and it's nothing short of a
nightmare, remembering to put in quotes, blah... blah... Use GRUPPE,
GROUPE or GRÚP or <insert term for group in language of your
choice...>.


>Though it is a reasonable recommendation to avoid using reserved words
>in a schema, because then you don't have to remember to use quoted
>identifiers.


Touché, or should I say touched? Prescisely my point. Why make life
difficult, when with a teeeeny tiiiny bit of effort, it can be made
easier?


Paul...


>Bill K.

--

plinehan __at__ yahoo __dot__ __com__

XP Pro, SP 2,

Oracle, 9.2.0.1.0 (Enterprise Ed.)
Interbase 6.0.1.0;

When asking database related questions, please give other posters
some clues, like operating system, version of db being used and DDL.
The exact text and/or number of error messages is useful (!= "it didn't work!").
Thanks.

Furthermore, as a courtesy to those who spend
time analysing and attempting to help, please
do not top post.
.



Relevant Pages

  • Re: Avatox 1.0: Trouble with encoding in Windows
    ... Ada is designed to read like English, so in most cases identifiers should be in English. ... In many cases that could be achieved by a preliminary translation phase that converts the reserved words into Ada's English reserved words. ... For a truly international language, instead of reserved words, maybe we should have symbols: ...
    (comp.lang.ada)
  • Re: Need to parse SQL statements...use regular expression?
    ... PL/I allowed reserved words to be identifiers in the 1960s but it never ... A blank line or semicolon, is the normal terminator in most command line sql ...
    (comp.lang.perl.misc)
  • Re: Avatox 1.0: Trouble with encoding in Windows
    ... Ada is designed to read like English, so in most cases identifiers ... I worked on several project were identifiers form system requironments ... translation phase that converts the reserved words into Ada's English ...
    (comp.lang.ada)
  • Re: Misplaced parenthesis
    ... I've always treated OPL directives ... as reserved words. ... "Directives have special meanings in Object Pascal, but, unlike reserved ... appear only in contexts where user-defined identifiers cannot occur. ...
    (comp.lang.pascal.delphi.misc)