At 11:04 AM 5/3/2001 -0800, John C. Landers wrote:
>>Doing sql like this with dates causes an exception:
>>
>>SELECT * FROM SOME_TABLE WHERE ? IN (DATE_0,DATE_1)
>I'm pretty sure this isn't valid SQL, regardless of the RDBMS
implementation.
>You can use a data parameter in place of a constant expression.
>The "IN" predicate expects its left operand to be a row value expression
>(more commonly, a column reference).
>You could use this query instead:
>SELECT * FROM SOME_TABLE WHERE DATE_0 = ? OR DATE_1 = ?
>And pass the same data value as a parameter twice when you execute the
query.
I would accept this answer but if you use non dates (numbers or varchars )
with instantdb it works.
select * from some_table where 'abc' in ( VARCHARCOL1,VARCHARCOL2);
Also this query works fine in Oracle and MSSqlServer.
Our software uses this style of query and using the 'or' solution
would increase our bind variables '?' times 5 which is already at
around 10. So 50 bind variables would not perform as well.
So if this was fixed we could use instantdb.
Thanks, jcl.
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.
|