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.

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

Figure 5.14 – SQL and XQuery editor <strong>for</strong> Script1.sql<br />

Figure 5.14 shows the empty script in the editor. At the top of the editor is the editor<br />

toolbar, which displays the database connection in<strong>for</strong>mation. In this case, Connection:<br />

localhost – <strong>DB2</strong> – GSDB. You can show or hide the detailed database connection<br />

in<strong>for</strong>mation in the editor toolbar by clicking the control arrow next to the connection, as<br />

shown in Figure 5.15.<br />

Figure 5.15 – Reviewing the database connection in<strong>for</strong>mation<br />

You can use the command pane, found below the editor toolbar, to control the<br />

configuration, validation, special registers, and per<strong>for</strong>mance metrics preferences <strong>for</strong> your<br />

scripts. You can show or hide this pane. We will discuss these tabs in depth in the next<br />

sections of this chapter.<br />

5.2 Changing the database connection<br />

As we saw in the last section, the editor toolbar shows in<strong>for</strong>mation about the current<br />

connection to the associated database. When you are developing your SQL script, the<br />

database connection determines the in<strong>for</strong>mation that is available in content assist, and the<br />

vendor and version of the database determines the syntax validation of your SQL<br />

statements. The database connection also might affect the results when you run the SQL<br />

script. You can change the database that the script is connected to by clicking the Select<br />

button on the Configuration tab, as shown in Figure 5.16.

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

Saved successfully!

Ooh no, something went wrong!