12.07.2015 Views

Oracle SQL Developer

Oracle SQL Developer

Oracle SQL Developer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Using Snippets to Insert Code FragmentsRelated TopicsUsing the <strong>SQL</strong> Worksheet1.7 Using <strong>SQL</strong>*PlusYou can use the <strong>SQL</strong>*Plus command-line interface to enter <strong>SQL</strong> and PL/<strong>SQL</strong>statements accessing the database associated with a specified connection. To displaythe <strong>SQL</strong>*Plus command window, from the Tools menu, select <strong>SQL</strong>*Plus.To use this feature, the system on which you are using <strong>SQL</strong> <strong>Developer</strong> must have an<strong>Oracle</strong> Home directory or folder, with a <strong>SQL</strong>*Plus executable under that location. If thelocation of the <strong>SQL</strong>*Plus executable is not already stored in your <strong>SQL</strong> <strong>Developer</strong>preferences, you are asked to specify its location (see <strong>SQL</strong>*Plus Location).If you do not have a <strong>SQL</strong>*Plus executable on your system, you can execute come<strong>SQL</strong>*Plus statements using the <strong>SQL</strong> Worksheet (see <strong>SQL</strong>*Plus Statements Supportedand Not Supported in <strong>SQL</strong> Worksheet), and you can also use the <strong>SQL</strong> <strong>Developer</strong> scriptrunner feature to emulate a limited set of <strong>SQL</strong>*Plus features (see Script Runner).For more information about using <strong>SQL</strong>*Plus, see <strong>SQL</strong>*Plus: Usage Information.Related Topics<strong>SQL</strong>*Plus Location (dialog box)<strong>SQL</strong>*Plus: Usage Information<strong>SQL</strong>*Plus Statements Supported and Not Supported in <strong>SQL</strong> WorksheetScript Runner<strong>SQL</strong> <strong>Developer</strong> Concepts and Usage1.8 Using Snippets to Insert Code FragmentsSnippets are code fragments, such as <strong>SQL</strong> functions, Optimizer hints, andmiscellaneous PL/<strong>SQL</strong> programming techniques. Some snippets are just syntax, andothers are examples. You can insert and edit snippets when you are using the <strong>SQL</strong>Worksheet or creating or editing a PL/<strong>SQL</strong> function or procedure.To display snippets, from the View menu, select Snippets. In the snippets window (onthe right side), use the drop-down to select a group (such as Aggregate Functions orCharacter Functions). In most cases, the fragments in each group do not represent allavailable objects in that logical grouping, or all formats and options of each fragmentshown. For complete and detailed information, see the <strong>Oracle</strong> Databasedocumentation.A Snippets button is placed in the right window margin, so that you can display thesnippets window if it becomes hidden.To insert a snippet into your code in a <strong>SQL</strong> Worksheet or in a PL/<strong>SQL</strong> function orprocedure, drag the snippet from the snippets window and drop it into the desiredplace in your code; then edit the syntax so that the <strong>SQL</strong> function is valid in the currentcontext. To see a brief description of a <strong>SQL</strong> function in a tooltip, hold the pointer overthe function name.For example, you could type SELECT and then drag CONCAT(char1, char2) from theCharacter Functions group. Then, edit the CONCAT function syntax and type the restof the statement, such as in the following:SELECT CONCAT(title, ' is a book in the library.') FROM books;<strong>SQL</strong> <strong>Developer</strong> Concepts and Usage 1-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!