TOAD can easily format a SELECT or INSERT statement for any data-oriented object (view or table). Simply place the cursor on the object you want and press F4. This will perform a describe on the object, as illustrated in Figure 4.23. Figure 4.23. Object description.
Notice in Figure 4.23 that everything you need to know about the object appears in this window.
Most of this information is covered in other chapters. To get to the SQL templates, use the Columns tab and right-click on any of the column names . This brings up another menu of mostly administrative functions (most of these features are covered in other chapters), as shown in Figure 4.24. Notice where the cursor is (Generate Statement); you have the choice of building a SELECT or INSERT statement for this particular object. When making a selection, TOAD will tell you that the "script copied to the clipboard." Figure 4.25 shows the code in the TOAD Procedure Editor that was pasted from the clipboard. Figure 4.24. TOAD Generate Statement selection.
Figure 4.25. Generated SQL statements.
You can also use the Show SQL Template Window button (third toolbar, rightmost button) to paste in specific SQL templates while doing PL/SQL coding. Figure 4.26 illustrates how to use these templates. Options include directly copying the template into the Procedure Editor (as illustrated in Figure 4.26) or copying the template to the clipboard. Notice that there are all kinds of SQL templates. TOAD contains templates for row, group , and date functions. Figure 4.26. TOAD SQL templates in action.
|