-
Notifications
You must be signed in to change notification settings - Fork 1
packages tree.attach_blob
Jan Kvetina edited this page Oct 10, 2020
·
4 revisions
Repository spec: tree.attach_blob
,
body: tree.attach_blob
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_blob
with BLOB
payload and optional name and it will be attached to your recent logs.log_id
.
PROCEDURE attach_blob (
in_payload logs_lobs.payload_blob%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_blob (
in_payload logs_lobs.payload_blob%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_blob := in_payload;
rec.lob_name := in_lob_name;
rec.lob_length := DBMS_LOB.GETLENGTH(rec.payload_blob);
--
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_blob (
in_payload => NULL, -- your BLOB
in_name => 'FILE_NAME' -- optional name
);
END;