Domanda

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.

È stato utile?

Soluzione 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; 

Altri suggerimenti

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!)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top