41.6 SET_TENANT_ID Procedure

This procedure is used to associate a session with a tenant ID which can be used for building multitenant Oracle APEX applications. Once set, the value of the current tenant can be retrieved using the built-in APP_TENANT_ID.

Syntax

APEX_SESSION.SET_TENANT_ID (
    p_tenant_id );

Parameters

Table 41-5 SET_TENANT_ID Parameters

Parameter Description
p_tenant_id The tenant ID to associate with a session

Raises

PE.DISPLAY_GROUP.SESSION_NOT_VALID: The session doesn't exist.

WWV_FLOW_SESSION_API.TENANT_ID_EXISTS: The tenant ID has already been set.

Example

begin
    apex_session.set_tenant_id (
        p_tenant_id => 'ABC');
 
end;