SQL Editor
Options for the SQL Editor
You access the Toad Options menu via the Configure Toad Options button on the main toolbar or by selecting the View| Options menu item.
SQL Editor Options are in three dialogs: Options | SQL Editor,
Options | Editors, and Edit | Editor Options.
The Options| SQL Editor contains numerous options on three pages.
SQL Options page
Only show one SQL Editor per database connection
Default - Unchecked
If checked, Toad will permit only one SQL Editor window to be opened per connection. This is similar to the one Schema Browser and one Procedure Editor per connection options.
Scan statements for bound variables before execution
Default - Checked
If checked, Toad will scan SQL statements for bound variables and ask you for the values before execution. If unchecked Toad sends the query as is to Oracle.
Default - Unchecked
If checked, Toad will show the statement execution time in the status panel. If unchecked, Toad will show the statement execution time until you perform further editing, then the status panel will show the row and col location of the cursor in the editor.
61
Toad for Oracle
Automatically poll for DBMS Output if Output detected
Default - Unchecked
If checked, Toad scans statements run in the SQL Editor, looking for a
DBMS_OUTPUT.PUT_LINE statement. If one is found, then Toad enables DBMS
Output, polls once, and then disables DBMS Output again. The default is unchecked.
Apply COMMIT and ROLLBACK to all tabs in the SQL Editor. This only
applies when threaded queries are used.
Default - Unchecked
Prompt to save contents when closing editor
Default - Checked
If checked, Toad will prompt you to save any text you typed in the editor.
If unchecked, you will still be prompted to save modified files loaded into the editor.
Close query (grid) when clearing the SQL Editor
Default - Checked
If checked, this clears the Data grid whenever you clear the SQL Editor.
Allow Clear All Text (buttons and F7 hotkey)
Default - Checked
If checked, you can press the F7 key to clear all text from the SQL Edit window without a confirmation dialog. If unchecked, F7 will not work, but you can still use the Edit | Clear All menu item.
Max # of SQL statements to save textbox
The default number is 100. The maximum is 999, but performance will be impacted.
This box lets you enter a custom number of SQL statements to save to your
Recall Previous SQL list. The list is saved to and retrieved from the savedsql.xml file. Only the most recently used SQL statements are saved.
62
SQL Editor
Save only statements that are valid
Default - Checked
If this option is checked, Toad will only save the SQL statements that ran successfully for recall via F8 SQL Statement Recall dialog.
Write saved SQL statements to disk prior to statement Execution
Default - Unchecked
If checked, then Toad writes the list of saved SQL (everything in the SQL Recall window) to the disk just prior to SQL execution. This ensures that if the query crashes Toad during the execution, your SQL history is not lost. Note that it will not save the current option if the option to only save valid SQL is checked, because validation occurs after the query executes.
Make Code page
Make Code and Strip Code, including the Make Code option page are discussed earlier in the Make Code Statement and Strip Code Statement section of this chapter.
Script Options page
Login Scripts frame
Glogin.sql (traditionally for group login settings) and login.sql (user’s personal login settings) are Oracle standards and used by SQL*Plus and other applications. Toad supports these for SQL Editor script executions. The boxes are read-only. Toad uses a SQL*Plus algorithm to find them.
Glogin.sql is executed first and then login.sql is executed. So any settings in login.sql will take precedence over any settings that coexist in glogin.sql.
glogin.sql
glogin.sql is usually located in the ORACLE_HOME\sqlplus\admin folder.
You can edit this file by clicking the Edit File button. The file will open in your selected text editor.
63
Toad for Oracle
login.sql
Login.sql can be used to store initial settings for a script execution session.
Toad finds login.sql by searching the initial working directory of Toad at startup.
It is usually the installation folder unless you have changed the start location.
If login.sql is not found there, Toad searches the SQLPATH for the active home.
SQLPATH can contain many directories each separated by a semicolon.
Execute login scripts
Default - Never
Radio buttons let you select Never, On SQL Editor startup, On reset settings.
Restore SET option defaults before each script execution
Default - Checked
When checked, the SQL Plus SET options will be restored to their default values each time a script is executed in the SQL Editor. If unchecked, changes remain for all executions that follow.
Script Output frame
Limit output from SELECT queries to X rows, 0 will fetch all rows
Entering a number in this box will limit your SELECT to that number of rows. Any results beyond that number of rows will be truncated. 0 shows all rows.
The default is 0.
Font button
This button lets you select the font for your script output.
Default - Courier
64