-
Notifications
You must be signed in to change notification settings - Fork 1
packages tree.attach_xml
Jan Kvetina edited this page Oct 10, 2020
·
1 revision
Repository spec: tree.attach_xml
,
body: tree.attach_xml
If you want to investigate large objects you want be able to do that with 4000 chars limit on logs.message
nor logs.arguments
.
For this purposes you can call tree.attach_xml
with XMLTYPE
payload and optional name and it will be attached to your recent logs.log_id
.
PROCEDURE attach_xml (
in_payload logs_lobs.payload_xml%TYPE,
in_lob_name logs_lobs.lob_name%TYPE := NULL,
in_log_id logs_lobs.log_id%TYPE := NULL
);
Show code (19 lines)
PROCEDURE attach_xml (
in_payload logs_lobs.payload_xml%TYPE,
in_lob_name logs_lobs.lob_name%TYPE := NULL,
in_log_id logs_lobs.log_id%TYPE := NULL
) AS
PRAGMA AUTONOMOUS_TRANSACTION;
--
rec logs_lobs%ROWTYPE;
BEGIN
rec.log_parent := COALESCE(in_log_id, tree.log_module(in_log_id, in_lob_name));
--
rec.log_id := log_id.NEXTVAL;
rec.payload_xml := in_payload;
rec.lob_name := in_lob_name;
rec.lob_length := DBMS_LOB.GETLENGTH(XMLTYPE.GETCLOBVAL(rec.payload_xml));
--
INSERT INTO logs_lobs VALUES rec;
COMMIT;
END;
PROCEDURE your_procedure AS
BEGIN
tree.log_module();
-- your code
NULL;
-- attaching file to recent log (in this case log_module call)
tree.attach_xml (
in_payload => XMLTYPE('<root></root>'), -- your XML
in_name => 'FILE_NAME' -- optional name
);
END;