compound conditions for FIND

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
vinsnash
Posts: 415
Joined: Sun Oct 07, 2007 4:58 pm

compound conditions for FIND

Post by vinsnash »

Is this a bug or intended?

When I use the simple form to create a query

IF OBJA.XYZ = 'P' AND

OBJA.ABC = 'W' OR
OBJA.ABC = 'Y' OR
OBJA.ABC = 'V' OR
OBJA.ABC = 'G'

It produces in the text form

FIND OBJA WHERE (OBJA.XYZ = 'P' AND OBJA.ABC = 'W') OR OBJA.ABC = 'Y' OR OBJA.ABC ='V' OR OBJA.ABC = 'G'

The result for the above FIND, of course, is not what was intended. I'm looking for XYZ = ' P' combined with anyone of the ABC values. Shouldn't the syntax produced be:

FIND OBJA WHERE (OBJA.XYZ = 'P)' AND (OBJA.ABC = 'W' OR OBJA.ABC ='Y' OR OBJA.ABC = 'V' OR OBJA.ABC = 'G'))

I modify the output in the 'text' form and it works as intended.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

A simple form query would have no way of knowing your intended result. So, AwareIM allows you go get "under the hood" like you did to achieve your intended result.
Tom - V8.8 build 3137 - MySql / PostGres
vinsnash
Posts: 415
Joined: Sun Oct 07, 2007 4:58 pm

Post by vinsnash »

I like being able to get "under the hood" so to speak. Fortunately I have some Boolean background and can figure it out. It would be nicer if the documentation spelled out a little better what should be left alone and what needs to be modified.

Thanks for the reply.

Vins Nash
technopak
Posts: 287
Joined: Thu Dec 04, 2008 2:16 pm

Post by technopak »

Hi,

I must admit that it seems like a shortcoming (albeit a small one) that the simple query builder allows you to build a complex query which it can't interpret.

It makes more sense that the simple query builder only builds what is can cope with - probably something that support needs to consider modifying.

Peter
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Good point Peter. But the flip side is that the simple query builder gives you a running start before you look under the hood.
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply