Tim Bunce wrote:
> 
> p.s. Of course the SQL standards team should be ashamed of creating
> a syntax that risks breakage with things like:
>         "update foo set bar=bar-$value"
> (If you can't see it, consider what happens if $value is negative."

Good point. How will the preparser handle this?  It will presumably have
to turn double minus style comments into C-style comments and therefore
will have to decide if any given double minus sign occuring in a string
is a comment or a minus operator applied to a negative number.  I would
guess the best way is to treat "--X", where X is a positive number, as
part of a statement and all other double minuses as comment introducers.
In SQL::Parser I will be able to be more accurate since I can first
treat the double minuses as math, test the validity of the statement
with that treatment and then if the statement is invalid, treat them as
comments instead and if the statement is still invalid, throw an error.

I'll berate Joe Celko on the comp.databases.theory newgroup. He's the
only one on the SQL92 standards committee I have easy access to. :-).

-- 
Jeff

Reply via email to