Yes, that this is mainly for SQLite and thanks for explaining and that is
what I thought.
I think square brackets are better than double quotes as it looks better
and parsing SQL
gets easier as the opening and closing character are not the same. But then
for compatibility
with other DB's double quotes are better.

RBS

On Sat, Nov 11, 2017 at 4:52 PM, R Smith <rsm...@rsweb.co.za> wrote:

> On 2017/11/11 1:04 PM, Bart Smissaert wrote:
>
>> What are the exact rules for valid identifier names (tables, columns and
>> indexes)?
>> This is both for names enclosed in square brackets ([]) or double quotes
>> (") and also for names
>> that are not enclosed within square brackets or double quotes.
>>
>
> The question is phrased quite generally, but if you perhaps meant w.r.t.
> SQLite specifically - It's quite straight forward:
>
> An Identifier can be any text, including non-standard characters (Unicode
> Chinese etc.) and including no text at all (empty string) as long as it is
> quoted with Identifier-compatible quotation marks.
>
> Valid Identifier Quotation characters are:  [, ], ` and "
>
> Further to this, an Identifier can remain unquoted (plain text), except:
> - when it is empty text or
> - when it contains any characters outside the ASCII Alpha-numeric
> characters and Underscore, or
> - when it starts with a number (digit), or  (Suddenly not 100% sure of
> this, may need to check it)
> - when it is the same as an SQLite Keyword.
>
> Further to this, SQLite will be very forgiving if you use the wrong type
> of quotes in some circumstances (where the intention is obvious), or have
> an identifier that is the same as a keyword but you only use it in a phrase
> where the keyword can't possibly be found.
>
> Read more about it here:
> http://sqlite.org/lang_keywords.html
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to