Statements > Save Sql Script under a New Name
  
Save Sql Script under a New Name
The contents of the edit pane can be saved under a new script file name by selecting the File/Save Sql As.. menu option. A 'save as' file dialog will then appear to allow the specification of a directory and name for the new script. Once a file location and name have been chosen the contents of the edit pane are saved to the script file and the new script name is placed on the window title bar. The original script file is left unchanged.
 
Printing Scripts
The contents of the edit pane (i.e. the sql script) can be printed. To do so ensure that the cursor is located in the edit pane and select the File/Print menu option.
The contents of the table tree and results pane can not be printed directly. See the Handling Results chapter for an explanation of how to acquire printed results.
 
Executing
There are a number of different methods for executing code in the edit pane. The appropriate method and syntax depends on the type of statement or statements in the edit pane. Refer to the following sections on how to execute using the appropriate method.
 
Executing Sql Statements
A sql statement or group of statements can be executed by selecting the Sql/Run menu option or by pushing the blue run button on the toolbar. Alternatively the Escape key can be used to execute the statements.
The entire contents of the edit pane are executed when one of the run options is selected. If multiple sql statements exist then they will be executed sequentially. To prevent a statement from running it must be commented out, by placing two dash characters at the front of each line.
A sql statement is deemed to be everything up to a semi-colon. It is not therefore possible to compile a stored procedure or execute a statement block using one of the run options. A procedure would, for example, be considered a number of distinct sql statements.
TIP: Do not use the run option to compile procedures or execute statement blocks. See the following sections on how to handle these entities.
 
Executing Procedures
A database stored procedure can be executed from the edit pane. The syntax required is however not intuitive. Stored procedures will be considered either Functions (returning a value) or Procedures (where no value is returned). Note that Procedures may return values in their parameter list.