Fixed a bug in the SQL statement for a transactional