extracted commonly usable code that makes select a query statement as DBAgent::makeSelectStatement().