Object Describe
The F4, or Describe Object button, is one of the most versatile features of Toad. Simply put the cursor on a function, table, or other object in the editor window and press the F4 key, and detail about the object appears. The F4 or Describe window is useful for displaying object information and table information including data, syntax, and statistics. You can also access this screen by entering DESC <object name> in the SQL Editor.
Figure 3.10 shows a Describe Objects panel. You can call one up by pressing F4 with the cursor on the EMP table in the editor window. Notice the tabs across the center of the screen. Using those tabs you can easily access the other related objects, constraints, statistics, code, privileges, and more.
FIGURE 3.10 Describe Objects panel
You can drag and drop column names on the Columns tab onto the SQL window and show other information such as available indexes, constraints, triggers, and so on from this interface as well. This section covers the more important tabs individually.
The location of the Describe Objects panel can be adjusted. Figure 3.11 shows the buttons that control how the panel appears on the screen.
FIGURE 3.11 EMP Table Describe Objects panel buttons
Buttons across the top of this panel (see Figure 3.12) control many items surrounding the object. Use the mouse and hover over any button to display a short description of its function. These buttons include:
- Add objects to this object
- Add to project manager (discussed later in this book)
- Alter/analyze/audit
- Compare
- Create another similar
- Create a script
- Show in various diagrammers
- Generate SQL (generates a select/insert/update/delete and puts it on the clipboard)
- Count/truncate
FIGURE 3.12 EMP Table Describe Tab buttons
The Script tab, shown in Figure 3.13, creates a script that could be saved and used to re-create the object. You can copy this script into a file and use it when creating a test environment for your application. Figure 3.14 shows the options available when you click the Options button on this script panel. Notice the adjustments you can make to the scripts. You can include the data, include drop statements, exclude schema owners (useful when setting up tables/objects for other users), and make other adjustments. Figure 3.15 illustrates the other content that you can include in the script output as well.
FIGURE 3.13 EMP Table Describe Object panel showing Script tab
FIGURE 3.14 Script Tab Options panel
FIGURE 3.15 Script Tab Tables Option tab
The Export DDL button (shown in Figure 3.16) enables easy DDL syntax generation. Notice all the options available for optional syntax in the panel in Figure 3.17.
FIGURE 3.16 Export DDL panel
FIGURE 3.17 Export DDL Options panel
Figure 3.18 shows another data grid but just for the object selected. You can see the same navigation and data control buttons as discussed earlier for the SQL Editor Data Grid tab. Many features are common to all data grids and these are covered in detail in Chapter 5, “Working with Data.”
FIGURE 3.18 Data Grid panel
Clicking the Generate Statement button (see Figure 3.19) enables the easy creation of an Insert, Update, or Select statement from the visible columns of this data grid. Make your selection and then paste into the SQL Editor.
FIGURE 3.19 Generate Statement panel