Question: How to build complicated queries?

Dave Peticolas
03 Feb 2002 13:59:59 -0800

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sun, 2002-02-03 at 09:18, Derek Atkins wrote:
> I've been reading the query documentation but I don't
> understand how one is supposed to use the existing APIs
> to build a "complicated" query.
> For example, I want a query to be:
>         a && (b || (c && d))
> How would one use the QUERY_AND, QUERY_OR, etc. methods and
> xaccQueryAddTerm() API to build a query of this logic?=20
> I guess my question is: what's the API to specify the "order of
> logical operations", or how does one specify parens in a logical
> expression?

To ensure grouping in a complicated expression, it's
best to combine two simpler queries together with
xaccQueryMerge. So you might create the query for
c && d, and a query for 'b', and combine them, and
then combine the resulting query with one for 'a'.


Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see