Re: Complicated database problem



Paul 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).


In ANSI/ISO SQL, quoted identifiers are set off by double-quotes:

 SELECT * FROM "TABLE"

MySQL unfortunately differs from the standard and uses backticks:

 SELECT * FROM `TABLE`

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.

Regards,
Bill K.
.



Relevant Pages

  • Re: Complicated database problem
    ... Bill Karwin wrote: ... >identifiers, specifically so you can use reserved words as table names, ... therefore potential problems are again looming in the ...
    (comp.databases)
  • 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)