A script-enabled browser is required for this page to function properly.

SRW.CONTEXT_FAILURE built-in exception

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

Reports Builder raises this exception when a Reports Builder packaged function or procedure is called in the wrong context. In this table, 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; 

See also

About the Reports Builder built-in package (SRW)

SRW built-in package