|
Posted by Toby A Inkster on 07/16/07 14:15
Jerry Stuckle wrote:
> Looks like I need to get an updated version of the SQL standard then.
> The one I have doesn't indicate double quotes are legal. Can you point
> me to the section in the ANSI standard which shows that? It would save
> me a lot of looking - these things are not the easiest to read :-).
ANSI SQL 1992, section 5.2 indicates the syntax for "tokens", by which it
means the identifiers you use to refer to tables and columns (and views
and various other things).
It defines a "delimited identifier" as consisting of a double quote,
followed by a "delimited identifier body" followed by another double
quote. The definition of the "delimited identifier body" is quite
convoluted but it ends up saying that it can be any sequence of one or more
characters, but internal double-quotes need to be escaped by doubling them
up. e.g. the following are legal delimited identifiers:
"foo"
"foo bar"
"foo""bar"""
You can be entirely forgiven for not having spotted this though -- SQL
1992 is over 600 pages of seemingly opaque jargon with, as far as I can
tell, not a single syntax example given. It really makes you appreciate W3C
specs and the PHP manual!
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 25 days, 17:34.]
demiblog 0.2.0 Released
http://tobyinkster.co.uk/blog/2007/06/28/demiblog-0.2.0/
[Back to original message]
|