A statement terminator is a single character. By default,
the SQL and XQuery editor uses a semicolon ( ; ) as the default statement
terminator. You can change the default statement terminator or specify
a different statement terminator for the SQL statements in a script
that you create in the SQL and XQuery editor.
A script can have multiple statement terminators. A statement terminator
applies to all of the SQL statements that follow it, until the next
statement terminator command is encountered. You can specify different
statement terminators in different SQL scripts.
The statement terminator that you specify for an SQL script persists
every time that you open the script in the SQL and XQuery editor.
Existing occurrences of the default statement terminator are not updated
in the SQL script; you must change them manually.
If you specify a statement terminator other than the default, a
special comment statement is added to the top of the SQL script that
indicates the statement terminator that you specified.
You might need to change the SQL statement terminator depending
on which statements you are adding to the script. For example, when
you add a CREATE PROCEDURE statement, the terminator cannot be a semicolon,
which is the default, because semicolons are used inside the CREATE
PROCEDURE statement. You can change the SQL statement terminator in
the following situations:
- Opening a script
- In the Validation tab of the SQL and XQuery editor
- Using the pop-up menu in the editor
- Adding special comment statements while editing a script