16.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.

172 <strong>Getting</strong> <strong>Started</strong> <strong>with</strong> <strong>IBM</strong> <strong>Data</strong> <strong>Studio</strong> <strong>for</strong> <strong>DB2</strong><br />

5.3.1 Validating the syntax in SQL and XQuery statements<br />

As you enter statements in the editor, the syntax of the statements is validated. The<br />

statements are parsed to determine whether keywords and their location in the statements<br />

are valid. The validation options that you specify determine the parser that is used.<br />

By default, the selected parser is based on the type of database that the script is<br />

connected to. As you can see in Figure 5.20, the Validate statement syntax <strong>for</strong> current<br />

configuration option is selected, which means the selected parser is based on the type of<br />

database that the script is connected to on the Configuration tab.<br />

For example, suppose you develop a script that creates aSALES table <strong>with</strong> an index in the<br />

<strong>DB2</strong>ADMIN schema of theGSDB database. In Figure 5.21, the script shows no syntax<br />

errors <strong>with</strong> the <strong>DB2</strong> <strong>for</strong> Linux, UNIX and Windows (V10.1) parser.<br />

Figure 5.21 – Statements validated <strong>with</strong> current configuration associated <strong>with</strong> the<br />

script<br />

However, if you want to eventually run this script on a different database server, you can<br />

validate it against that server type <strong>with</strong>out changing your current database connection.<br />

Simply select the option to validate the statement syntax and select a different parser from<br />

the list. Currently, parsers <strong>for</strong> the following types of databases are available in the SQL and<br />

XQuery editor:<br />

• <strong>DB2</strong> <strong>for</strong> Linux, UNIX, and Windows (V10.1)<br />

• <strong>DB2</strong> <strong>for</strong> Linux, UNIX and Windows (V9.8)<br />

• <strong>DB2</strong> <strong>for</strong> Linux, UNIX, and Windows (V9.7)

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

Saved successfully!

Ooh no, something went wrong!