Added code to read query results from database to be merged.