Define errors
DataBlade® module routines can print error messages and trace messages. Error messages are printed with the mi_db_error_raise() function. Trace messages are written to a trace file with the DBDK_TRACE macros or the gl_dprintf() macro.
Although it is possible to hard-code messages in your routines, defining them in BladeSmith makes them easier to edit. Also, BladeSmith generates code that uses the HCL OneDB™ Global Language Support (GLS) API, so messages that you create in BladeSmith can be easily localized.
The following table lists the properties you specify when you create
an error.
Property | Default value | Description |
---|---|---|
SQL error code | None | A five-character error code. This character string
uniquely identifies the error or trace message. See SQL error code for more information. |
Error locale | The locale of your Windows™ installation | the HCL
OneDB locale
specification for the message. See Error locale for more information. |
Register message as error, trace, or both? | Error | Error messages are added to the syserrors system table. Trace messages are added to the systracemsgs system table. If you choose Both, the message is added to both system tables. |
SQL error text | None | A character string that can contain embedded parameters
to be replaced with current values at run time. See SQL error text for more information. |
The following sections describe properties of errors.