Catching errors in SQL xlat queries