ISSUE 5256: Modified call to function queryDB for efficiency