I agree with your and Dan's point about possible precision loss. I am trying to find a way where rather than hard coding the -?/+? to Double, try to get it's datatype from the context where it is used.

There are circumstances where you can figure this out, but it's ambiguous in the general case. For example:

   where t1.int_column + ? = - ?

Since both sides of the "=" operator have parameters, you can't use the type of one side to figure out the type of the other side.

Here are some more examples of ambiguity:

   where t1.int_column = ? / - ?

   where - ? not in (select t1.int_column + ? from . . .)

I don't think it's a good idea to try to solve this problem at all. There are a few cases where it's obvious what the type should be, and many more where it's not. There's also an easy workaround (use the CAST function). Even if we were able to figure out an algorithm to determine the type of a parameter in all cases, would it be possible to explain the behavior to an average user?


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

Reply via email to