Question: How to build complicated queries?

Dave Peticolas dave@krondo.com
03 Feb 2002 13:59:59 -0800


--=-N23WeiA2AbaZ2a/SpkHG
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.
>=20
> For example, I want a query to be:
>=20
>         a && (b || (c && d))
>=20
> How would one use the QUERY_AND, QUERY_OR, etc. methods and
> xaccQueryAddTerm() API to build a query of this logic?=20
>=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'.

dave


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8XbLf5effKKCmfpIRAigFAKCTaERkWevNtpY655uRdTNGfgtRpwCg1K+i
mnrdk2QbuK/pQtGaeakFyPs=
=/BjP
-----END PGP SIGNATURE-----

--=-N23WeiA2AbaZ2a/SpkHG--