Extracted helper method

fdbsql needs to wrap this with a retry loop for NotCommitted errors
when in autocommit mode.