test on sub query; pass dbType from a main query to the sub-queries.