-
Notifications
You must be signed in to change notification settings - Fork 1
packages sess.get_contexts
Jan Kvetina edited this page Oct 9, 2020
·
2 revisions
Repository spec: sess.get_payload
,
body: sess.get_payload
This function converts current contexts into payload string.
FUNCTION get_contexts
RETURN sessions.contexts%TYPE;
Show code (17 lines)
FUNCTION get_contexts
RETURN sessions.contexts%TYPE
AS
out_payload sessions.contexts%TYPE;
BEGIN
SELECT
LISTAGG(s.attribute || sess.splitter_values || s.value, sess.splitter_rows)
WITHIN GROUP (ORDER BY s.attribute)
INTO out_payload
FROM session_context s
WHERE s.namespace = sess.app_namespace
AND s.attribute != sess.app_user_attr -- user_id has dedicated column
AND s.attribute NOT LIKE '%\_\_' ESCAPE '\' -- ignore private contexts
AND s.value IS NOT NULL;
--
RETURN out_payload;
END;
BEGIN
tree.log_module();
-- print current contexts as string
DBMS_OUTPUT.PUT_LINE(sess.get_payload());
END;
/