Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Index term
secondaryexecute
primaryscript
Index term
secondaryexecute
primarySQL statement
In the SQL Commander, you can execute one or multiple statements. You can also control if the execution should stop or continue when the execution of a statement results in a warning or error.

Table of Contents

Execute a Script with Multiple Statements

Use the SQL Commander->Execute main menu operation to execute the SQL in the SQL Commander editor. The SQL Commander executes the statements one by one and indicates the progress in the log area. The currently selected Database Connection is used for all statements. The SQL Commander does not support executing SQLs for multiple database connections in one batch. 

...

If you select a statement in the SQL editor and choose SQL Commander->Execute main menu option, only the selected statement is executed. This is a useful feature when you have several SQL statements in the SQL editor and you just want to execute one or a few of the statements.

Note

Comments in the SQL editor are sent to the database when you use SQL Commander->Execute, unless you have enabled SQL Commander Options->Strip Strip Comments when Executing in the SQL Commander menu->SQL Commander Options menu.

Execute Only the Current Statement

Include Page_OnlyInPro_OnlyInProThe SQL Commander->Execute Current operation is useful when you have a script with several SQL statements. It lets you execute the statement at the cursor position without first having to select the SQL statement. The default key binding for execute current is Ctrl-PERIOD (Ctrl-.).

Note

Execute Current determines the actual statement by parsing the editor buffer using the standard statement delimiters.The current statement is the statement containing the caret or that ends on the line with the caret. This means that the caret may be after the statement delimiter as long as there is no other statement on the same line.

If you are unsure what the boundaries are for the current statement then use Edit->Select Current Statement. This will highlight the current statement without executing it.

Execute Buffer

The SQL Commander->Execute Buffer sends all of the content in the SQL editor to the database in a single run. This is useful when executing complex SQL statements such as CREATE STORE PROCEDURE (or similar) where statement splitting on semicolon must not be done as with SQL Commander->Execute and SQL Commander->Execute Current.

Control Execution after a Warning or an Error

...