On Mon, 2005-01-10 at 18:00 -0500, D. Richard Hipp wrote:
> A user has reported a bug saying that SQLite does
> not allow the '$' in the middle of indentifiers
> (without quoting).  The bug reports says that
> statements like this:
> 
>     CREATE TABLE ex$1( col$abc INTEGER );
> 
> are legal and work fine in other database engines.
> This seems very odd to me.  Can anybody else
> confirm the use of '$' in the middle of identifier
> names in other database engines?

I find quoting to be satisfactory, and use it whenever attributes are
called for that aren't of the set [a-zA-Z]+

Nevertheless, I think it should be useful to understand why someone
would want this. I presume most people on this list are familiar with $-
expansion in most modern interpretive languages (esp. considering the
strong ties to php, tcl, and perl the list members seem to have).

Fortran allows the dollar-sign in variable names, and it's common! Many
Fortran programmers use the dollar-sign in the absence of real
structures and classes- I can imagine this making porting Fortran code
easier.

VMS uses the dollar-sign in a similar way- to separate classes (think:
SYS$CURRENCY or COB$CARDREADER :) )

Many REXX programmers use the dollar-sign as part of an identifier to
represent a kind of "global" scope (e.g. $.foo and EXPOSE $.) - some
REXX programmers end up "thinking" SQL in the same way.

Now a dissent: Some SQL interfaces (Informix comes to mind) use the
dollar-sign BECAUSE it's not allowed in SQL to mean "this follows is
SQL". I cannot imagine allowing the dollar-sign _in_ identifiers would
mess this up, but it might screw up Really Stupid Parsers[tm].

I don't think it would make many TCL or PERL programmers happy to see $
being what (in their mind) could be overloading. It might introduce
confusion. Simply requiring it be quoted could help alleviate it. Then
again, those programmers aren't likely to take advantage of it.

Again: I'm fine with quoting. I don't particularly like the idea of
barewords changing meanings, but I confess to taking advantage of it.

Reply via email to