I've been thinking about where "- ?" should be allowed in queries. Currently, parameters are allowed only in certain situations - the documentation lists seventeen different places where parameters can be used. These places were chosen because it's possible to figure out the type of the parameter from the context. For example, a parameter can be used as the first operand of BETWEEN as long as the one of the second and third operands is not a parameter.

It seems to me that a parameter could be used with a unary minus anywhere a "bare" parameter is allowed. Derby could use the same rules to determine the type of the parameter as if the minus weren't there. Obviously, there would have to be an error if the type isn't numeric.

I don't think we should allow unary minus on parameters in any other cases. This seems obvious, but it means poring over the code and looking for all the places where parameters are excluded, and making it look for parameters under a unary minus.


                       -        Jeff Lichtman
                                [EMAIL PROTECTED]
                                Check out Swazoo Koolak's Web Jukebox at
http://swazoo.com/

Reply via email to