runSelectQuery now also returns the variable names