Question

I want to list out all the tables and their associated columns which are referenced in a stored procedure.

How can i do it in oracle?

Thanks in advance.

Was it helpful?

Solution 2

You can get tables referenced using this query

SELECT referenced_owner, 
       referenced_name, 
       referenced_type 
FROM   dba_dependencies 
WHERE  name = 'MYPROC' 
       AND owner = 'SCOTT' 
ORDER  BY referenced_owner, 
          referenced_name, 
          referenced_type; 

OTHER TIPS

You can't get all table dependencies in all_dependecies view. If dynamic sql is using in one procedure then the table won't be in dba_dependecies view. So in that case, you could see the table in dba_source (if table name in not a parameter of the function!)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top