cancel
Showing results for 
Search instead for 
Did you mean: 

SQLErrText

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Remark number 1

HTH, Paul

Former Member
0 Kudos

Thanks. That's what I was looking for.

Appreciated.

Answers (0)