fixed SQL statement