Skip to Content
avatar image
Former Member

SQLErrText

Hello,

How does one go about getting the Sql Error Text associated with the SQLCODE in a SQLAnywhere 16 stored procedure. I can't seem to find a variable like the PowerBuilder SQLErrText that would hold this text. For example, for SQLCODE = -195, the message text is "Column '%1' in table '%2' cannot be NULL" How do I get the full message with the parameters filled in in a stored procedure?

For Example:

EXCEPTION

     WHEN OTHERS THEN

        SET ls_sqlcode = String(SQLCODE);

        ROLLBACK;

        CALL notfy_notification('H', 'I', 'ERROR','Error in Procedure SQLCODE: ' || ls_sqlcode, null);

        raiserror 18002 '18002 Error SQLCODE: ' || ls_sqlcode;

END;

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jun 11, 2016 at 12:32 AM

    Did you try the ErrMsg() function. Here in DocCommentXchange

    Remark number 1

    HTH, Paul

    Add comment
    10|10000 characters needed characters exceeded