17.10.2015 Views

Getting Started with IBM Data Studio for DB2

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5 – Creating SQL and XQuery scripts 175<br />

Figure 5.24 – Validate database object reference error in a DML statement<br />

5.3.3 Changing the statement terminator<br />

When you have multiple statements in an SQL script, each statement must be separated<br />

from the one that follows by a statement terminator. By default, the SQL and XQuery editor<br />

uses a semicolon (;) as the statement terminator. You can change the default statement<br />

terminator <strong>for</strong> all scripts that you create in the editor by specifying the new default<br />

statement terminator in Window -> Preferences.<br />

You can specify a statement terminator <strong>for</strong> a specific script in the Validation tab. The<br />

statement terminator that you set in an SQL script persists every time that you open the<br />

script in the SQL and XQuery editor.<br />

In a given script, you can use only one statement terminator. That is, all the statements in<br />

an SQL script must use the same statement terminator. When you set the statement<br />

terminator in an SQL script that contains existing statements, the editor does not update<br />

the existing statement terminators automatically. Instead, you must manually update all of<br />

the existing statement terminators in the script.<br />

Figure 5.25 shows an example of the syntax validation error that occurs after you set the<br />

statement terminator to an exclamation point (!), and do not update an existing statement<br />

terminator. You will get an unexpected token error if you run the script after you stop<br />

validating the syntax.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!