The example in the slide shows the execution plan. The Execute Explain Plan icon generates the execution plan. An execution plan is the sequence of operations that will be performed to execute the statement. You can see the execution plan by clicking the Explain tab.
Oracle Database 10 g : Develop PL/SQL Program Units F-16 Copyright © 2006, Oracle. All rights reserved. Formatting the SQL Code Before formatting After formatting Formatting the SQL Code You may want to beautify the indentation, spacing, capitalization, and line separation of the SQL code. SQL Developer has the feature of formatting the SQL code. To format the SQL code, right-click in the statement area, and select Format SQL . In the example in the slide, before formatting, the SQL code has the keywords not capitalized and the statement not properly indented. After formatting, the SQL code is beautified with the keywords capitalized and the statement properly indented.
Oracle Database 10 g : Develop PL/SQL Program Units F-17 Copyright © 2006, Oracle. All rights reserved. Using Snippets Snippets are code fragments that may be just syntax or examples. Using Snippets You may want to use certain code fragments when you are using the SQL Worksheet or creating or editing a PL/SQL function or procedure. SQL Developer has the feature called Snippets. Snippets are code fragments, such as SQL functions, Optimizer hints, and miscellaneous PL/SQL programming techniques. You can drag snippets into the Editor window. To display Snippets, select View > Snippets . The Snippets window is displayed on the right side. You can use the drop-down list to select a group. A Snippets button is placed in the right window margin, so that you can display the Snippets window if it becomes hidden.
Oracle Database 10 g : Develop PL/SQL Program Units F-18 Copyright © 2006, Oracle. All rights reserved. Using Snippets: Example Inserting a snippet Editing the snippet Using Snippets: Example To insert a Snippet into your code in a SQL Worksheet or in a PL/SQL function or procedure, drag the snippet from the Snippets window into the desired place in your code. Then you can edit the syntax so that the SQL function is valid in the current context. To see a brief description of a SQL function in a tool tip, place the cursor over the function name. The example in the slide shows that CONCAT(char1, char2) is dragged from the Character Functions group in the Snippets window. Then the CONCAT function syntax is edited and the rest of the statement is added such as in the following: SELECT CONCAT(first_name, last_name) FROM employees;
Oracle Database 10 g : Develop PL/SQL Program Units F-19 Copyright © 2006, Oracle. All rights reserved. Using SQL*Plus • The SQL Worksheet does not support all SQL*Plus statements. • You can invoke the SQL*Plus command-line interface from SQL Developer.
You've reached the end of your free preview.
Want to read all 322 pages?
- Fall '14
- The Hours, Oracle Database, Oracle Corporation, PL/SQL program units