20.1 Constants and Attributes Used for Result Types

The following constants are used for the API parameter p_display_location and the attribute display_location in the t_error and t_error_result types.

c_inline_with_field            constant varchar2(40):='INLINE_WITH_FIELD';
c_inline_with_field_and_notif  constant varchar2(40):='INLINE_WITH_FIELD_AND_NOTIFICATION';
c_inline_in_notification       constant varchar2(40):='INLINE_IN_NOTIFICATION';
c_on_error_page                constant varchar2(40):='ON_ERROR_PAGE';

The following constants are used for the API parameter associated_type in the t_error type.

c_ass_type_page_item           constant varchar2(30):='PAGE_ITEM';
c_ass_type_region              constant varchar2(30):='REGION';
c_ass_type_region_column       constant varchar2(30):='REGION_COLUMN';

The following record structure is passed into an error handling callout function and contains all the relevant information about the error.

type t_error is record (
    message                 varchar2(32767),             
        /* Error message which will be displayed */
    additional_info         varchar2(32767),             
        /* Only used for display_location ON_ERROR_PAGE to display additional error information */
    display_location        varchar2(40),                
        /* Use constants "used for display_location" below */
    association_type        varchar2(40),                
        /* Use constants "used for asociation_type" below */
    page_item_name          varchar2(255),               
        /* Associated page item name */
    region_id               number,                      
        /* Associated tabular form region id of the primary application */
    column_alias            varchar2(255),               
        /* Associated tabular form column alias */
    row_num                 pls_integer,                 
        /* Associated tabular form row */
    apex_error_code         varchar2(255),               
        /* Contains the system message code if it's an error raised by APEX */
    is_internal_error       boolean,                     
        /* Set to TRUE if it's a critical error raised by the APEX engine, like an invalid SQL/PLSQL statements,
        ... Internal Errors are always displayed on the Error Page */
    is_common_runtime_error boolean,                     
        /* TRUE for internal authorization, session and session state errors that normally should not be masked 
        by an error handler */
    ora_sqlcode             number,                      
        /* SQLCODE on exception stack which triggered the error, NULL if the error was not raised by an ORA error */
    ora_sqlerrm             varchar2(32767),             
        /* SQLERRM which triggered the error, NULL if the error was not raised by an ORA error */
    error_backtrace         varchar2(32767),             
        /* Output of sys.dbms_utility.format_error_backtrace or sys.dbms_utility.format_call_stack */
    error_statement         varchar2(32767),             
        /* Statement that was parsed when the error occurred - only suitable when parsing caused the error */
    component               apex_application.t_component,
        /* Component which has been processed when the error occurred */
);

The following record structure must be returned by an error handling callout function.

type t_error_result is record (
    message             varchar2(32767),  /* Error message which will be displayed */
    additional_info     varchar2(32767),  /* Only used for display_location ON_ERROR_PAGE
                                          to display additional error information */
    display_location    varchar2(40),     /* Use constants "used for display_location" below */
    page_item_name      varchar2(255),    /* Associated page item name */
    column_alias        varchar2(255)     /* Associated tabular form column alias */
);