After an application program executes a SQL statement, it can examine a return code (or status code) for errors.
The return code indicates whether the statement executed successfully or failed and gives the reason for the failure.
See SQL Anywhere Server - SQL Usage > Stored Procedures and Triggers > Using procedures, triggers, and batches > Errors and warnings in procedures and triggers.