Monday, 11 December 2023

UTL_CALL_STACK : Get Detailed Information About the Currently Running Subprogram

 Oracle database 12c introduced the UTL_CALL_STACK package to allow programmatic access to the call stack and error stack, giving much greater flexibility for debugging and error handling of PL/SQL code. This is only a replacement for the existing functionality if you need the extra level of control. The existing functionality in the DBMS_UTILITY package is still available and has not been deprecated.

  • Call Stack     prior to it we use DBMS_UTILITY.format_call_stack
  • Error Stack   prior to it we use DBMS_UTILITY.format_error_stack
  • Backtrace     prior to it we use DBMS_UTILITY.format_error_backtrace

The UTL_CALL_STACK package contains APIs to display the contents of the call stack in a more readable form.

refer https://oracle-base.com/articles/12c/utl-call-stack-12cr1

  • DYNAMIC_DEPTH : The number of subprograms on the call stack, starting at the current position in the call stack, to the initial call.
  • LEXICAL_DEPTH : Lexical depth of the subprogram within the current call.
  • UNIT_LINE : Line number in the subprogram of the current call.
  • SUBPROGRAM : Subprogram name associated with the current call.
  • CONCATENATE_SUBPROGRAM : Returns the UNIT.SUBPROGRAM.LOCAL_SUBPROGRAM form of the subprogram name.
  • OWNER : The owner of the subprogram associated with the current call.

No comments:

Post a Comment