3.4 STOP_APEX_ENGINE Procedure

This procedure signals the Oracle APEX engine to stop further processing and immediately exit to avoid adding additional HTML code to the HTTP buffer.

Note:

This procedure raises the exception APEX_APPLICATION.E_STOP_APEX_ENGINE internally. You must raise that exception again if you use a WHEN OTHERS exception handler.

Syntax

APEX_APPLICATION.STOP_APEX_ENGINE

Parameters

None.

Example 1

This example tells the browser to redirect to http://apex.oracle.com/ and immediately stops further processing.

owa_util.redirect_url('http://apex.oracle.com');
apex_application.stop_apex_engine;

Example 2

This example tells the browser to redirect to http://apex.oracle.com/ and immediately stops further processing. The code also contains a WHEN OTHERS exception handler which deals with the APEX_APPLICATION.E_STOP_APEX_ENGINE used by APEX_APPLICATION.STOP_APEX_ENGINE.

BEGIN
    ... code which can raise an exception ...
    owa_util.redirect_url('http://apex.oracle.com');
    apex_application.stop_apex_engine;
EXCEPTION
    WHEN apex_application.e_stop_apex_engine THEN
        RAISE; -- raise again the stop APEX engine exception
    WHEN others THEN
        ...; -- code to handle the exception
END;