buildQuery
q[a] = buildQuery(nn, qc);
db_query *buildQuery(int num_components, db_qcomp *components);