Oracle Apex - Session state

About

Session state is a workspace that contains all variables with their values for one user.

Scope

Session state can be maintained:

See the “Maintain session state attribute” of the “Source” section of an item.

_

Management

View

Session state are variable.

_

API

You can use the APEX_UTIL package to get and set session state,

  • FETCH_APP_ITEM Function. This function fetches session state for the current or specified application in the current or specified session of an item
  • GET_NUMERIC_SESSION_STATE Function
  • GET_SESSION_STATE. PLSQL/SQL. Shorthand, function V.

SET

With:

BEGIN
    APEX_UTIL.SET_SESSION_STATE('my_item','myvalue');
END;
  • the equal assignment
BEGIN
    :MY_ITEM := :MY_SECOND_ITEM;
    :MY_ITEM := 'myValue';
END;
  • SELECT INTO statement
BEGIN
    SELECT 1 INTO :MY_ITEM FROM DUAL;
END;

Powered by ComboStrap