Updated on 2025-07-15 GMT+08:00

DBE_UTILITY

APIs

Table 1 provides all APIs supported by the DBE_UTILITY package.

Table 1 DBE_UTILITY

API

Description

DBE_UTILITY.FORMAT_ERROR_BACKTRACE

Outputs the call stack of an abnormal stored procedure.

DBE_UTILITY.FORMAT_ERROR_STACK

Outputs detailed information about a stored procedure exception.

DBE_UTILITY.FORMAT_CALL_STACK

Outputs the call stack of a stored procedure.

DBE_UTILITY.GET_TIME

Outputs the current time, which is used to obtain the execution duration.

  • DBE_UTILITY.FORMAT_ERROR_BACKTRACE

Returns the call stack where an error occurs during execution. The prototype of the DBE_UTILITY.FORMAT_ERROR_BACKTRACE function is as follows:

1
2
DBE_UTILITY.FORMAT_ERROR_BACKTRACE()
RETURN TEXT;
  • DBE_UTILITY.FORMAT_ERROR_STACK

Returns the detailed information about the error location when an error occurs during the execution. The prototype of the DBE_UTILITY.FORMAT_ERROR_STACK function is as follows:

1
2
DBE_UTILITY.FORMAT_ERROR_STACK()
RETURN TEXT;
  • DBE_UTILITY.FORMAT_CALL_STACK

Sets the call stack of the output function. The prototype of the DBE_UTILITY.FORMAT_CALL_STACK function is as follows:

1
2
DBE_UTILITY.FORMAT_CALL_STACK()
RETURN TEXT;
  • DBE_UTILITY.GET_TIME

Sets the output time, which is usually used for difference. A separate return value is meaningless. The prototype of the DBE_UTILITY.GET_TIME function is as follows:

1
2
DBE_UTILITY.GET_TIME()
RETURN BIGINT;

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
CREATE OR REPLACE PROCEDURE test_get_time1() 
AS
declare
    start_time  bigint;
    end_time  bigint;
BEGIN
    start_time:= dbe_utility.get_time ();
    pg_sleep(1);
    end_time:=dbe_utility.get_time ();
    dbe_output.print_line(end_time - start_time);	
END;
/