20220111 - 글로벌 변수 Global Variables

1. Application Item 생성

Shared Components - Application Items


2. 로그인 인증 함수에 변수 셋팅 추가

F_AUTHENTICATE_USER


    -- Compare the two, and if there is a match, return TRUE
    if l_hashed_password = l_password then
        -- Good result. 
        APEX_UTIL.SET_AUTHENTICATION_RESULT(0);
        APEX_UTIL.SET_SESSION_STATE('G_PROVIDER', l_provider);
        return true;
    else
        -- The Passwords didn't match
        APEX_UTIL.SET_AUTHENTICATION_RESULT(4);
        return false;
    end if;


3. 각 페이지에서 앞서 생성한 글로벌 변수 Application Item 호출

Page Item - Default

Type : Function Body

Language : PL/SQL

PL/SQL Function Body : return v('G_PROVIDER')



참고

https://orclqa.com/question/how-to-create-and-use-global-variables-accross-applications-in-oracle-apex/

https://docs.oracle.com/en/database/oracle/application-express/21.2/aeapi/APEX_APPLICATION-Global-Variables.html#GUID-5164592B-6864-4E2B-8DE3-64B463687A41 

https://docs.oracle.com/en/database/oracle/application-express/20.1/htmdb/understanding-substitution-strings.html#GUID-3AFC7346-902C-4DCA-8D28-960BD8FC6628

댓글 없음:

댓글 쓰기

20250202 - IG 다운로드 버튼 바로 보이기

JS initialization Code : function (config) {     var $ = apex.jQuery,         toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),  ...