How to find all table links from Oracle 10G PL / SQL functions and procedures?

How to find all table links from Oracle 10G PL / SQL functions and procedures?

I can definitely execute the following SQL statement:

select * from dba_source where text like '%tbl_c%'

but I am wondering how to find all the functions that call the functions related to the table being used. For example, I can have a function A that calls a function B that uses the tbl_c table. If I execute the aforementioned SQL, I will find funciton B, but then I need to execute another SQL to find A. As you know, the cyclomatic complexity can be 3,4,5 levels in depth or even more.

Very grateful for your explanation.

+3
source share
2 answers

dba_dependencies - . :

 SELECT      owner
             || '.'
             || NAME
             || ' ('
             || DECODE (TYPE,
                        'MATERIALIZED VIEW', 'MV',
                        'DIMENSION', 'DIM',
                        'EVALUATION CONTXT', 'EVALCTXT',
                        'PACKAGE BODY', 'PKGBDY',
                        'CUBE.DIMENSION', 'CUBE.DIM',
                        TYPE
                       )
             || ')' objdep,
                referenced_name
             || ' ('
             || DECODE (referenced_type,
                        'EVALUATION CONTXT', 'EVALCTXT',
                        'NON-EXISTENT CONTXT', 'NO-EXIST',
                        'PACKAGE BODY', 'PKGBDY',
                        'CUBE.DIMENSION', 'CUBE.DIM',
                        referenced_type
                       )
             || ')' refr
        FROM dba_dependencies
       WHERE owner = :usn
    ORDER BY objdep;
+3

ALL_DEPENDENCIES , ALL_SOURCE. , , .

+1

Source: https://habr.com/ru/post/1756260/


All Articles