Updated on 2024-10-14 GMT+08:00

DBE_UTILITY

Interface Description

Table 1 provides all interfaces supported by the DBE_UTILITY package.

Table 1 DBE_UTILITY

Interface

Description

DBE_UTILITY.FORMAT_ERROR...

Outputs a call stack of an abnormal stored procedure.

DBE_UTILITY.FORMAT_ERROR...

Outputs detailed information about the stored procedure exception.

DBE_UTILITY.FORMAT_CALL_...

Output a 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

The stored procedure FORMAT_ERROR_BACKTRACE returns the call stack where an error occurs during execution. The DBE_UTILITY.FORMAT_ERROR_BACKTRACE function prototype is as follows:

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

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

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

The stored procedure FORMAT_CALL_STACK sets the call stack of the output function. The DBE_UTILITY.FORMAT_CALL_STACK function prototype is as follows:

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

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

1
2
DBE_UTILITY.GET_TIME()
RETURN BIGINT;

Example

 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;
/