Skip to content

adm_audit_api

This document contains the API documentation for the adm_audit_api package.

Writes one audit row, stamped with the current identity and channel.

p_action_details longer than the column can hold - 4000 characters, and 4000 bytes on a multibyte database - is truncated with a trailing ’…’ rather than raising. Everything else that goes wrong here is raised, so a genuine audit failure still aborts the caller.

Signature:

procedure add_audit (
p_action_type in adm_audit_log.action_type%type,
p_action_details in adm_audit_log.action_details%type default null,
p_document_id in adm_audit_log.document_id%type default null,
p_folder_id in adm_audit_log.folder_id%type default null
);

Parameters:

NameDirectionTypeDescription
p_action_typeinadm_audit_log.action_type%typeOne of the c_action_* constants
p_action_detailsinadm_audit_log.action_details%type default nullFree text describing the action
p_document_idinadm_audit_log.document_id%type default nullThe document the action applies to
p_folder_idinadm_audit_log.folder_id%type default nullThe folder the action applies to; the root folder is used when
neither a document nor a folder is given |

The identity that add_audit stamps on a row.

Exposed so that callers writing many audit rows in one statement - the subtree operations in adm_folder_api - can stamp them the same way add_audit would without having to know how the identity is derived. Read it once into a local and bind it, rather than calling it per row.

Signature:

function current_user_id return adm_audit_log.user_id%type;

Returns: adm_audit_log.user_id%type - the ADM context username when there is one, else the APEX session user, else the database user


The access channel that add_audit stamps on a row. See [current_user_id].

Signature:

function current_user_access return adm_audit_log.user_access%type;

Returns: adm_audit_log.user_access%type - the access source of the ADM context when there is one, else ‘APEX’ inside an APEX session and ‘DB’ otherwise