views:

35

answers:

1

Hi all I am new to DATABASE. I am trying to figure out the way to find the procedure dependent on another procedure.

Below query is giving me the dependecy of PROC1. ie Procedure called by PROC1

select REFERENCED_NAME from user_dependencies where name = 'PROC1' ;

Below things I want to know:

1) Is this query even work same for Function. ?

2) Is this query is recursive ie PROC1 calls-> PROC2 calls ->PROC3 calls -> PROC4 Ie: when I call the query for PROC1 whill it give all dependency or only one level dependency(ie PROC2).

3) If the procedure is inside the package to find the dependency what should be the query ?

+4  A: 
  1. yes

  2. no, it only shows an immediately level of dependency

  3. user_dependencies only shows a dependency at the package level, not for individual procedures and functions within the package.

PL/Scope (introduced in 11g) allows you to find usages at the procedure/function level within a package, but it only works if it's enabled when the code is compiled.

Jeffrey Kemp
In general: Is this possible to call the proc1 in Package1 by the proc2 which is in Package2 ? and The query in question is it even identifies triggers. ?
@user430294: yes, as long as proc1 is declared in the package header; otherwise it's private and con only be used within the body of Package1. And the owner of Package2 has execute privileges on Package1.
Alex Poole
@user430294: yes, `user_dependencies` includes references in triggers.
Jeffrey Kemp