You are here: Re: How do I escape parentheses in a mysql query? « PHP Programming Language « IT news, forums, messages
Re: How do I escape parentheses in a mysql query?

Posted by Andy Hassall on 07/16/07 14:20

On Mon, 16 Jul 2007 07:22:37 -0400, Jerry Stuckle <jstucklex@attglobal.net>
wrote:

>Toby A Inkster wrote:
>> Jerry Stuckle wrote:
>>
>>> Nope, actually both are non-standard extensions. Quotes have no
>>> definition in standard SQL. Rather, table/column names can't be
>>> reserved words like GROUP, COLUMN, etc.
>>
>> No -- Andy was right. ANSI SQL (and the later ISO editions) specifies that
>> double-quotes may be used to quote identifiers. Single quotes are used for
>> strings; backticks aren't used for anything in particular.
>>
>> This is one of MySQL's most annoying quirks: in its normal mode it accepts
>> double-quotes for string values and insists on only backtick-quoted or
>> unquoted literals. Putting MySQL into ANSI mode fixes it.
>
>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 :-).

The production for <delimited-identifier> appears to be the place to look,
then you can track back from there up to the identifier and then select list
definitions.

<delimited identifier> ::=
<double quote> <delimited identifier body> <double quote>


--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация