31.5 ATTACH Procedure

This procedure based on the given application and session current, sets environment and runs the Initialization PL/SQL Code.

Syntax

PROCEDURE ATTACH (
    p_app_id     IN NUMBER,
    p_page_id    IN NUMBER,
    p_session_id IN NUMBER );

Parameters

Table 31-5 Attach Procedure Parameters

Parameters Description

p_app_id

The application id.

p_page_id

The application page.

p_session_id

The session id.

Raises

  • WWV_FLOW.APP_NOT_FOUND_ERR: Application does not exist or caller has no access to the workspace.

  • APEX.SESSION.EXPIRED: The session does not exist.

  • SECURITY_GROUP_ID_INVALID: Current workspace does not match session workspace.

Example

Attach to session 12345678 for application 100 page 1, then print the app id and session id.

begin
    apex_session.attach (
        p_app_id     => 100,
        p_page_id    => 1,
        p_session_id => 12345678 );
    sys.dbms_output.put_line (
        'App is '||v('APP_ID)||', session is '||v('APP_SESSION'));
end;