Description This exception stops the report execution and raises the following error message:
REP-1426: Running <construct_name> from incorrect context.
Syntax SRW.CONTEXT_FAILURE;
Usage Notes Report Builder raises this exception when a Report Builder packaged function or procedure is called in the wrong context (see the chart below).
In this chart, NO means that the function or procedure cannot be called in that context; YES means it can.
Name | Parameter Form | Data Model | Format Trigger | Report Trigger |
srw.break | NO | YES | YES | NO |
srw.do_sql | YES | YES | YES | YES |
srw.geterr_run | YES | YES | YES | YES |
srw.get_page_num | NO | NO | YES | NO |
srw.message | YES | YES | YES | YES |
srw.reference | YES | YES | YES | YES |
srw.run_report | YES | YES | YES | YES |
srw.set_attr | NO | NO | YES | NO |
srw.set_field_char | NO | NO | YES | NO |
srw.set_field_date | NO | NO | YES | NO |
srw.set_field_num | NO | NO | YES | NO |
srw.set_maxrow | NO | YES | YES | YES |
srw.user_exit | YES | YES | YES | YES |
Example
/* Suppose you want your own error message raised,
** instead of the default error message.
** You could handle this exception in the following way:
*/
EXCEPTION
when SRW.CONTEXT_FAILURE then
srw.message(4000, 'Contact the Application
Development group regarding SRW.CONTEXT_FAILURE.');
raise srw.program_abort;