Search notes:

Oracle: UTL_CALL_STACK.DYNAMIC_DEPTH

The dynamic depth is increased when a subprogram (function or procedure) is called and decreased again when the subprogram returns to the caller.
The dynamic depth of an SQL statement that is not executed in PL/SQL context is 0:
select
   utl_call_stack.dynamic_depth
from
   dual;
In anonymous block, the depth is 1:
begin
   dbms_output.put_line(utl_call_stack.dynamic_depth);
end;
/
Calling a procedure increases the depth by 1. The following example prints 2:
create or replace procedure tq84_print_dyn_depth as begin
   dbms_output.put_line(utl_call_stack.dynamic_depth);
end;
/

begin
   tq84_print_dyn_depth;
end;
/
This example prints 3:
create or replace procedure tq84_wrap_dyn_depth as begin
   tq84_print_dyn_depth;
end;
/

begin
   tq84_wrap_dyn_depth;
end;
/
Nested procedures also increase the depth: the following example prints 4:
create or replace procedure tq84_nesting_procs as
   procedure nested_proc as begin
      tq84_print_dyn_depth;
   end;
begin
-- tq84_print_dyn_depth;
   nested_proc; 
end;
/

begin
   tq84_nesting_procs;
end;
/
Cleaning up:
drop procedure tq84_nesting_procs;
drop procedure tq84_wrap_dyn_depth;
drop procedure tq84_print_dyn_depth;

See also

utl_call_stack

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759612693, '216.73.216.149', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/installed/packages/utl/call_stack/api/depth/dynamic(97): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78