Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

oracle

toad

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

like image 323
WENzER Avatar asked Mar 12 '10 09:03

WENzER


People also ask

How do I see triggers in Toad?

In the explorer, if you have Treelist view, expand following branches: Schemas -> [Your Schema Name] -> Triggers. For Tabbed navigation just switch to Triggers tab. If you click on trigger, in the viewer should appears properties with Remarks row (which is comment for trigger) (Fig. 1 [2]).

How do I view functions in Toad?

Open Explorer by click on icon in main menu (Fig. 1) or by Tools -> Explorer. In explorer : for Treelist view expand Schemas -> [your schema name] -> Functions.

Where are Toad views stored?

The views are stored in Toad and accessed through the Toad Views manager. You can use the Toad Views manager to organize your views into folders, to create new views, and to modify current views. Select View | Toad Views. Select a Toad View to display the view's SQL statement and the connection information.


2 Answers

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');
like image 52
a'r Avatar answered Oct 30 '22 05:10

a'r


In Toad menu, select Database -> Schema Browser. Use the tabs appeared to navigate between views, procedures, tables, trigger, functions...

like image 44
Nikita Koksharov Avatar answered Oct 30 '22 05:10

Nikita Koksharov