DBMS UTILITY
DBMS_UTILITY#
The DBMS_UTILITY package provides diverse utility subprograms.
The procedures and functions organizing the DBMS_UTILITY package are provided as shown in the table below.
Procedures/Functions | Description |
---|---|
FORMAT_CALL_STACK | Calls current stack information. |
FORMAT_ERROR_BACKTRACE | Calls the stack information of an error occurring point. |
FORMAT_ERROR_STACK | Calls information which is identical with the FORMAT_ERROR_BACKTRACE function. |
FORMAT_CALL_STACK#
The FORMAT_CALL_STACK is a function which display stack information at the call point and bring it to a character string.
Syntax#
VARCHAR variable := DBMS_UTILITY.FORMAT_CALL_STACK;
Result Value#
It returns the stack information at the call point.
Exception#
There is no exception.
Example#
iSQL> create or replace procedure proc1
is
a integer;
begin
a := 1;
println( dbms_utility.format_call_stack );
end;
/
Create success.
iSQL> create or replace procedure proc2 as begin
proc1;
end;
/
Create success.
iSQL> exec proc2;
object line object
handle number name
6261376 6 procedure "SYS.PROC1"
6258720 2 procedure "SYS.PROC2"
Execute success.
FORMAT_ERROR_BACKTRACE#
The FORMAT_ERROR_BACKTRACE is a function which retrieves stack information at the point in which an exception was occurred. If no exception had been incurred, NULL value would be returned.
Syntax#
VARCHAR variable := DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
Result Value#
It returns the stack information at the point in which an exception was occurred. If no exception had been incurred, NULL value would be returned.
Exception#
There is no exception.
Example#
iSQL> create or replace procedure proc1
is
a integer;
begin
a := 'aaaaa';
end;
/
Create success.
iSQL> create or replace procedure proc2 as begin
proc1;
exception
when others then
println( dbms_utility.format_error_backtrace );
end;
/
Create success.
iSQL> exec proc2;
ERR-21011 : Invalid literal
at "SYS.PROC1", line 5
at "SYS.PROC2", line 2
Execute success.