On Nov 25, 2007 10:29 PM, Niels Nes
On Sun, Nov 25, 2007 at 10:20:25PM +0100, Markus Gritsch wrote:
Hi,
I have another question with an SQL query that works in SQLite and MySQL but does not in MonetDB.
SELECT * FROM test WHERE ((1) AND (id=100)) syntax error, unexpected AND in: "prepare select * from test where ((1) and"
The query is forged by an ORM. I programmatically put together the WHERE clause. All the contitions are put together using AND, and in the case of no conditions, the WHERE clause simply reads (1), which yields all entries in the table. However, MonetDB cannot parse this. I guess its a default casting problem. As I expect the following to work: select * from test where ((true) and (id=100))
No, this yields: TypeException:user.s0_2[15]:'calc.max' undefined in: _23:any := calc.max(_19:bit, _22:int) TypeException:user.s0_2[16]:'calc.min' undefined in: _24:any := calc.min(_19:bit, _22:int) TypeException:user.s0_2[17]:'algebra.uselect' undefined in: _25:any := algebra.uselect(_18:bat[:oid,:bit], _23:any, _24:any, _17:bit, _17:bit) TypeException:user.s0_2[19]:'algebra.markT' undefined in: _28:any := algebra.markT(_25:any, _26:oid) TypeException:user.s0_2[20]:'bat.reverse' undefined in: _29:any := bat.reverse(_28:any) TypeException:user.s0_2[21]:'algebra.join' undefined in: _30:any := algebra.join(_29:any, _12:bat[:oid,:int]) TypeException:user.s0_2[28]:'algebra.join' undefined in: _40:any := algebra.join(_29:any, _39:bat[:oid,:str]) TypeException:user.s0_2[35]:'algebra.join' undefined in: _51:any := algebra.join(_29:any, _50:bat[:oid,:lng]) TypeException:user.s0_2[42]:'algebra.join' undefined in: _59:any := algebra.join(_29:any, _58:bat[:oid,:lng]) TypeException:user.s0_2[49]:'algebra.join' undefined in: _67:any := algebra.join(_29:any, _66:bat[:oid,:lng]) TypeException:user.s0_2[56]:'algebra.join' undefined in: _77:any := algebra.join(_29:any, _76:bat[:oid,:lng]) TypeException:user.s0_2[63]:'algebra.join' undefined in: _88:any := algebra.join(_29:any, _87:bat[:oid,:lng]) TypeException:user.s0_2[70]:'algebra.join' undefined in: _96:any := algebra.join(_29:any, _95:bat[:oid,:bit]) TypeException:user.s0_2[77]:'algebra.join' undefined in: _106:any := algebra.join(_29:any, _105:bat[:oid,:timestamp]) TypeException:user.s0_2[84]:'algebra.join' undefined in: _114:any := algebra.join(_29:any, _113:bat[:oid,:int]) Markus