fixed error in sql statement for loading batch