The toolbar appropriate to PL/SQL development opens when you create / open a stored object in the Code Editor. Each of the toolbar icons is described below. In addition, all standard editing functions are available. For more information, see Edit, Compile And Execute.
Icon | Tool Tip | Description | ||
---|---|---|---|---|
Back | Navigate between hyperlinked database objects (in the editing pane) and their dependent objects and components. | |||
Forward | ||||
New SQL | Write a single SQL statement or a series of SQL statements in a new editing pane. The toolbar will open for SQL development. | |||
New Stored Object | Create a stored object. Open the New Stored Object Dialog. | |||
Open File |
Open an external file in the Code Editor. An alternative way to open file is to drag and drop a file from Windows Explorer to the SQL Navigator window. | |||
Save to File | Save the contents of the current Code Editor pane to an external file. | |||
Open Object | Locate a stored object using the Select DB Object Dialog and open the object in the editing pane. | |||
Auto Code Completion | Turn On/Off Auto Code Completion. When turned on, the Code Editor matches variables, parameters, procedures and types as you type. | |||
Vertical Split |
Adjust the layout of the editing pane. Select from the options to split the editing pane in half either horizontally or vertically. The content of the editing pane will be visible in both panes. You can scroll the panes independent of each other.
|
Icon | Tool Tip | Description | ||
---|---|---|---|---|
Open/Create Package Body | Navigate to a function/procedure inside the package body. | |||
Entry | Move the cursor to the function / procedure definition in the code. | |||
Undo all changes | Undo all changes since the last save. | |||
Generate DDL script | Generate a DDL script of the procedure / function / package. Switch between the DDL script and procedure / function / package using the tabs at the bottom of the screen. While the DDL script is on view the Code Editor toolbar adjusts to editing SQL code. | |||
Save to Database | Save changes. Submit the PL/SQL to the database, compile, and report errors | |||
Save to Database As (Clone) | Save (clone) the object. The new stored program will have a definition identical to the stored program currently open in the editor. Optionally select a new schema and name for the object. | |||
Execute Procedure / Function |
Open the PL/SQL Execution Console from editing mode. If the PL/SQL Execution Console is already open then execute the code.
| |||
Stop procedure execution | Use if required to stop execution of the procedure before it finishes. | |||
Toggle Breakpoint | Add / Remove breakpoint on the selected line of code. For more on debug see PL/SQL Debugger. | |||
PL/SQL Debugger |
You can watch the result values during runtime. You can run stored programs in parallel by opening additional sessions within SQL Navigator. Show/Hide the Toolbox PL/SQL Debugger | |||
Abort Debug Session | For more on debug see PL/SQL Debugger. |
To enable Team Coding see Administer Team Coding.
Icon | Tool Tip | Description | ||||
---|---|---|---|---|---|---|
Get Latest Revision |
Get the latest version of an object or script as it is held in the Version Control repository. The Get Latest Revision command overwrites the version of the object or script in the database, replacing it with the latest version held in the VCS repository. You can use the View Differences Dialog to compare versions before overwriting the object. | |||||
Check Out |
Check out or check in the current object or script. Open: | |||||
Check In | ||||||
Undo Check Out |
Cancel the check-out. You are prompted to confirm that you want to discard any changes you have made and restore the database version of the item as it was prior to check-out.
|
Icon | Tool Tip | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SQL Optimizer | SQL Optimizer | |||||||||||||||||||
Explain Plan | Explain Plan Tool | |||||||||||||||||||
PL/SQL Formatter |
Format PL/SQL, SQL*Forms, Oracle Forms, and SQL*Plus source code.
| |||||||||||||||||||
Knowledge Xpert | Search Knowledge Xpert | |||||||||||||||||||
Code Analysis | Code Analysis |
The Code Editor opens ready to edit SQL code. You will see the SQL Toolbar (Code Editor SQL) and a blank canvas to write SQL code. If you create / open objects requiring PL/SQL code you will see the PL/SQL Toolbar (Code Editor PL/SQL).
Features | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Standard Editing Functions |
All standard editing functions are available. See:
See also: Some functions are duplicated on the shortcut menu. Right click in the editing pane to open the shortcut menu. | ||||||||||||||||||||||||
Working with objects |
Drag and drop objects from the following SQL Navigator modules into the editing pane. Show the definition of the object at the cursor location:
Describe the object at the current cursor location:
| ||||||||||||||||||||||||
Automated Coding Assistance |
| ||||||||||||||||||||||||
Insert ready made code |
Insert ready made code into the editor.
To manage, create and edit the ready made code, see Code Templates. | ||||||||||||||||||||||||
Drag and drop PL/SQL syntax, SQL functions, column names, and database object names into code using the Code Assistant. | |||||||||||||||||||||||||
Code with multiple SQL statements and PL/SQL blocks |
| ||||||||||||||||||||||||
Execute the SQL query or Compile the PL/SQL code |
Execute the SQL query See: The toolbar: Code Editor SQL.
Compile the PL/SQL code See: Code Editor PL/SQL, PL/SQL Debugger, DBMS_OUTPUT. You can compile a program that is stored in the database. While the program is being edited, use the Save command to compile and store it. Once the program has been modified, you will need to save the program prior to any further usage of the Compile/Rebuild functionality - This is to ensure that the changes in the program have been applied to the database. SQL Navigator displays all syntax and compiler errors in a separate scrollable pane. Click on the error text to show the source code at the source of the error. Double click on the error text to show the error message description, cause and actions as per the Oracle documentation. Also watch for feedback in the Output Window.
Auto Reparse Many features of the Code Editor, including the Code Explorer window, code completion, tool tip display of program arguments, bracket matching, collapse loops/blocks, and others, rely on automatic parsing of the PL/SQL code and internally generating a symbol table. This parsing occurs when the editor first loads the objects, and it also occurs in the background in order to maintain the symbol table as the user edits the code. You can also manually trigger a full reparsing (updating of the internal symbol table) at any time by right-click and select Auto Reparse from the shortcut menu. However, when loading a really large script having this option on will slow down SQL Navigator. Hence, to avoid wasting CPU resources, you should turn this option off when editing large scripts.
Symbols in the gutter margin Symbols in the gutter margin provide a visual indication of the statement’s status.
| ||||||||||||||||||||||||
Look and Feel |
|
The Code Editor supports the following SQL*Plus commands:
|
Note: Consult Oracle documentation for details about Oracle's SQL*Plus utility. |
SQL Navigator also allows large scripts or SQL statements to be executed in the background, allowing you to perform other functions on your PC simultaneously.
Ensure that all the required scripts are in the same directory and in the correct SQL format.
In the Code Editor, invoke the master script using the @ command.
The output of the executed scripts will be displayed in the appropriate window of SQL Navigator, for example the output of a SELECT statement will appear in the grid (SQL Query Results Data Grid), while the output of a CREATE statement will appear under the appropriate node in DB Navigator.
To execute a SQL statement or script within the Code Editor, you must first be connected to the relevant database.
It is possible to connect and disconnect databases from within the Code Editor using SQL*Plus commands.
Connect |
Open a new Code Editor tab, and then type and execute a connect statement using the following SQL*Plus format Connect name/password@database | ||
Disconnect |
Open a new Code Editor tab, and then type and execute a disconnect statement using the following SQL*Plus format Disconnect name/password@database
|
A bind variable is a variable in a SQL statement that must be replaced with a valid value or address of a value in order for the statement to successfully execute.
Bind variables enable you to use PL/SQL in a SQL*Plus script. They provide a mechanism for returning data from a PL/SQL block so that it can be used in subsequent queries.
The Code Editor supports bind variables; use them the same way as you would use them in SQL*Plus.
Here is an example of how to declare a bind variable:
VARIABLE s_table_name varchar2(30)
To reference a bind variable in a PL/SQL block, preface it with a colon ( : )
BEGIN
:s_table_name := ‘EMPLOYEE’;
END;
/
Scenario: Use Point-And-Click to insert column names for a database object into your code.
Scenario: Show a parameters list for a procedure or function.
Type in the name of the procedure or function followed by an open bracket '('.
Automatic code completion brings up a list of parameters (including alternative lists for overloaded procs/funcs).
Scenario: Dot lookup for record members.
Type in the name of the variable followed by a full stop.
SQL Navigator displays a list of matching members. Dot-lookup automatically displays a ‘pick’ list of members of a PL/SQL record, cursor, package or %ROWTYPE record.
© ALL RIGHTS RESERVED. 이용 약관 개인정보 보호정책 Cookie Preference Center