Use the Load Database Object dialog to load an existing object into the Stored Edit/Compile window for further editing.
To load an object from the database
Note: You can turn the preview off by using the Show Source checkbox.
The reload object options give you an easy way to synchronize your PL/SQL source with objects also existing on the database.
You can reload objects in one of several ways.
To reload an object from the Navigator
To reload all objects from the Navigator
To reload from the Toolbar
Use the Create New PL/SQL Object dialog to create a new database object. Toad opens a dialog that enables you to specify the parameters for the CREATE statement and allows you to select a default or custom template to speed the creation of the object.
To create a new PL/SQL Object in the Editor
To create a new PL/SQL Object from the Schema Browser
The following default templates are stored in the Toad for Oracle\User Files folder:
Template | Purpose |
---|---|
Create a Procedure | |
Create a Function | |
NEWPackage.SQL |
Create a Package spec |
NEWPackageBody.SQL |
Create a Package body |
NEWType.SQL |
Create a Type spec |
NEWTypeBody.SQL |
Create a Type body |
NEWTrigger.SQL |
Create a Trigger spec |
In addition, there are two template types that you can use only within packages. These are Package Function and Package Procedure.
You can use a text editor to create new templates and edit the default templates. The new or revised template will be shown in the template selection drop-down when you create a new object.
To create a custom template
There are several keywords in the templates for which Toad will automatically substitute in values when you open the templates.
%YourObjectName% Object Name
%SYSDATE% Workstation date, for example, mm/dd/yyyy
%DATETIME% Workstation date and time, for example, mm/dd/yyyy hh:mm:ss am
%DATE% Workstation date, for example, mm/dd/yyyy
%TIME% Workstation time, for example, hh:mm:ss am
%USERNAME% Username specified in Toad Options, Editor node
%TRIGGEROPTS% Trigger Options for triggers only, for example, "Before insert on, for each row"
Note:
In addition to these, you can specify custom keywords before you create the object.
You can extract a procedure from existing code into a new stored procedure or locally defined procedure.
Creating the new procedure and call depend heavily on the parser to determine which identifiers in the text selection must be declared as parameters in the new procedure. If Toad cannot parse the code, no extraction occurs.
To extract procedures
Note: If you select stored procedure, you can choose to either include the CREATE OR REPLACE in the DDL instead of just CREATE.
Enter the procedure name.
Tip: The new procedure and the resulting procedure call are created an inserted so that the code is syntactically correct, but no formatting is done to the code. You can have Toad format the code by pressing SHIFT+CTRL+F.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Nutzungsbedingungen Datenschutz Cookie Preference Center