All the Editors have been integrated into one Toad Editor window. Supports multiple statements per tab. Because of this, the results of pressing <F9> and <SHIFT><F9> have changed.
Executing Statements
Toad supports query statements, DDL statements, blocks of procedure SQL, and so on.
In addition, Toad recognizes substitution variables in quotes as follows:
If & is escaped, Toad will not prompt for a value.
If & is the last character in a string, it is not considered a substitution variable.
Commands to execute code
<F9>
Pressing <F9> runs the statement at the cursor, or compiles the PL/SQL at the cursor. This does not include the contents of the entire window, unless the entire window contains only the statement or script at the cursor.
To execute the statement at the cursor
Press <F9>.
Or
Click the Execute Statement button on the toolbar.
To process a portion of the editor text
Highlight that portion and press <F9>.
Or
Click the Execute Statement button on the toolbar.
<SHIFT><F9>
Pressing <SHIFT><F9> runs only the snippet at the cursor. This does not run or compile entire procedures, functions, or triggers. When you press <SHIFT><F9> Toad runs everything between two of the following:
+ ; (a semi-colon)
+ a blank line
+ / (a forward slash)
+ End and beginning of file indicators
To execute a single statement among many statements (separated by at least one blank line)
Click or place the caret/cursor within the statement, or on the blank line after the statement you want to execute.
Press <SHIFT><F9>, or <CTRL><ENTER>.
Or
Click the Run Current Statement button on the toolbar.
Highlighting SQL Snippets
You can easily highlight bits of code so that an explain plan is run on only that code, or so that you can see what Toad is including as a part of the statement before you Execute it. Highlighting code uses the same logic as <SHIFT><F9>.
To highlight a SQL Snippet
Place your cursor in the code you want to highlight and then press <CTRL><H>.