You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Goncalo Luiz <ge...@rnl.ist.utl.pt> on 2003/02/01 02:43:32 UTC
True value in OQL
Hello.
I'm constructin a highly dynamic OQL query string. In some specific cases I
must include certain clauses...but this clauses are absent in other specific
cases.
To avoid extremly complicated if / then /else I concluded that it would be
easier to use a "true" value in the query string:
query = "select from CLASS" + "where (true and"
if (certain case) then query += "variable < x";
if (certain case) then query += "variable2 < y";
query += "and 1)"
thus, I must not test if there is already a condition, and then to include
an "and" etc...
The problem is, OQL doesn't like "true" neither "one".
What value may I use to force a positive comparision ?
In SQL if I use the query "select * from TABLE where 1" I get all the rows.
Thanks
Gonçalo D. Luiz IST, Portugal.