61.143 SET_WORKSPACE Procedure

This procedure establishes the workspace context for the current PL/SQL execution by setting the current Workspace ID. Use it when calling workspace-scoped APEX APIs from outside an APEX application context, such as from a Database Scheduler job or standalone PL/SQL code.

Note:

This procedure only changes the workspace context if the calling database user is mapped to the named workspace, or if the user has APEX_ADMINISTRATOR_ROLE database role. If the user is not allowed to access the workspace, no exception is raised and the workspace context is not changed.

Syntax

APEX_UTIL.SET_WORKSPACE (
    p_workspace IN VARCHAR2 )

Parameters

Parameters Description
p_workspace The workspace's short name.

Example

This example sets the workspace MY_WORKSPACE.

apex_util.set_workspace (
    p_workspace => 'MY_WORKSPACE' );