CREATE TABLE ZLOGINS_SESSIONS
(
ZTIME DATE DEFAULT SYSDATE,
ZUTIME DATE,
SESSION_ID VARCHAR2(100 BYTE) DEFAULT sys_guid(),
USER_ID VARCHAR2(100 BYTE),
MENU_CODE VARCHAR2(100 BYTE),
FUNCTION_CODE VARCHAR2(100 BYTE),
COUNTER_CODE VARCHAR2(100 BYTE),
FIRST_CONNECT DATE,
LAST_CONNECT DATE,
ZEMAIL VARCHAR2(100 BYTE),
ZUEMAIL VARCHAR2(100 BYTE),
XAPPID VARCHAR2(100 BYTE),
XPAGEID VARCHAR2(100 BYTE),
XSESSION VARCHAR2(100 BYTE),
XIPADR VARCHAR2(100 BYTE),
XMACADR VARCHAR2(100 BYTE)
);
=================================================
Go to Page
Click Pre-Rendering and create Process on Before Header
process Name : PageSessionsLogs
PL/SQL Code :
declare
vxid varchar2(100);
vxnumgrp varchar2(100);
vErrorNum varchar2(100);
vErrorMsg varchar2(500);
vIpadr varchar2(500);
begin
======= Insert to Session Log =========
INSERT INTO ZLOGINS_SESSIONS
(SESSION_ID, USER_ID, MENU_CODE, FUNCTION_CODE, COUNTER_CODE, FIRST_CONNECT, LAST_CONNECT
,ZTIME, ZUTIME, ZEMAIL, ZUEMAIL, XAPPID, XPAGEID, XSESSION,XIPADR, XMACADR )
VALUES
(:SESSION,:APP_USER, null,null,null, LOCALTIMESTAMP,LOCALTIMESTAMP
,LOCALTIMESTAMP, LOCALTIMESTAMP, :APP_USER, :APP_USER, :APP_ID, :APP_PAGE_ID, :SESSION, vIpadr, null
);
end;