Retrieving Stored procedures, Views, Functions, Triggers using Toad for Oracle

WENzER picture WENzER · Mar 12, 2010 · Viewed 58.1k times · Source

How can I get the scripts of Stored procedures, Views, Functions, Triggers in toad for oracle?

Answer

a'r picture a'r · Mar 12, 2010

In general, you should use dbms_metadata to retrieve DDL statements. eg.

select dbms_metadata.get_ddl('VIEW', 'V_MYVIEW') from dual;

This can of course be wrapped in a query over the data dictionary, eg.

select dbms_metadata.get_ddl(object_type, object_name) 
from user_objects
where object_type in ('VIEW', 'PROCEDURE', 'FUNCTION', 'TRIGGER');