In (syntax) version 8 and later, information about the success or failure of a Vortex <SQL> statement can be obtained from the $ret.code, $ret.token, and $ret.msg variables; see here.
<SQL>
$ret.code
$ret.token
$ret.msg