https://www.ibm.com/docs/en/db2/11.5.x?topic=programming-declaring-sqlca-error-handling
Declaring the SQLCA for Error Handling
You can declare the SQLCA in your application program so that the database manager can return information to your application.
declaringerrorhandling