Error messages
The database server cannot validate specifications for features that the access method adds. If the access method includes a feature that the database server cannot detect, the access method must explicitly handle syntax errors in requests for that feature. To handle errors that the database server cannot detect, call the DataBlade API mi_db_error_raise() function.
CREATE TABLE legacy
...
USING text_file_access(delimiter = '!')
if (mi_tab_amparam(tableDesc) != 'delimiter')
mi_db_error_raise( connection, MI_EXCEPTION,
"Invalid configuration keywordin the USING clause.");
The MI_EXCEPTION alerts the database server that an exception has occurred. If the function that called mi_db_error_raise() has registered a callback for MI_Exception (upper and lowercase), that callback is executed to handle the error.
The database server cannot always determine that the access method does not support a feature that a user specifies. The access method can test for the presence of specifications and either provide the feature or raise an exception for those features that it cannot provide.
- mi_tab_mode()
- The input and output mode (read-only, read and write, write only, and log transactions)
- mi_tab_isolevel()
- The isolation level
- mi_scan_locktype()
- The lock type for the scan
- mi_scan_isolevel()
- The isolation level in force