Board index » delphi » HELP: complex conditions, live results in QBE impossible?

HELP: complex conditions, live results in QBE impossible?

I have a query condition in the form "range_1 OR range_2". The obvious
translation would be (>=low1,<=high1) or (>=low2,<=high2), but this
produces a ") missing" error when executed. It seems that QBE doesn't
support parentheses at all, since every expression including them
produces this error. Even using SQL doesn't help, because all local
SQL is translated into QBE, so perfectly valid SQL syntax produces
this error too. I know I can put the two ranges on different QBE
lines, but I need to set a condition based on CALC COUNT, and
splitting the condition line will force me to use two queries, one to
CALC COUNT and the other to CALC SUM. Please, if you can explain this
behaviour or suggest some workaround, tell me.

A second problem, unrelated to this, is with the TQBE component.
Despite having a "RequestLive" property, it never seems to do so.
Again, I have no idea why.

Thanks in advance,
Ido Feldmann
(feld...@ibm.net)

 

Re:HELP: complex conditions, live results in QBE impossible?


Quote
feld...@ibm.net (Ido Feldmann) wrote:
>I have a query condition in the form "range_1 OR range_2". The obvious
>translation would be (>=low1,<=high1) or (>=low2,<=high2), but this
>produces a ") missing" error when executed. It seems that QBE doesn't
>support parentheses at all, since every expression including them
>produces this error. Even using SQL doesn't help, because all local
>SQL is translated into QBE, so perfectly valid SQL syntax produces
>this error too. I know I can put the two ranges on different QBE
>lines, but I need to set a condition based on CALC COUNT, and
>splitting the condition line will force me to use two queries, one to
>CALC COUNT and the other to CALC SUM. Please, if you can explain this
>behaviour or suggest some workaround, tell me.

A little more info might be useful to the SQL-meisters, esp. your
exact SQL query. One obvious possibility would be to make sure you
have parens on both sides of the OR (e.g. (v1 < 5) or (v2 > 7).

Quote
>A second problem, unrelated to this, is with the TQBE component.
>Despite having a "RequestLive" property, it never seems to do so.
>Again, I have no idea why.

Most times you can't get there from here (i.e. live query results from
a query of any complexity). This is alleged to have been fixed in
Delphi32. I bet Borland loses billions and billions of customers if it
isn't (they will definitely lose me, although I'm not sure where else
I'll go - I'll be homeless from a language perspective, I guess).
Quote
>Thanks in advance,
>Ido Feldmann
>(feld...@ibm.net)

Re:HELP: complex conditions, live results in QBE impossible?


On Tue, 05 Dec 1995 04:13:50 GMT, rf...@halcyon.com (Russell Fish)
wrote:

Quote

>A little more info might be useful to the SQL-meisters, esp. your
>exact SQL query. One obvious possibility would be to make sure you
>have parens on both sides of the OR (e.g. (v1 < 5) or (v2 > 7).

I was trying to use a QBE query, but the manual says that BDE
translates all SQL into QBE internally anyway. The thing is, I can run
queries like SELECT ... WHERE (x) or (y) or (z) etc., or SELECT
..WHERE (x) and (y) and (z), but I can't mix OR's and AND's in the
same condition, because this forces BDE to use parens and it {*word*88}s on
it. Any ideas?

Ido Feldmann
(feld...@ibm.net)

Other Threads