16.10.2015 Views

Getting Startedwith pureQuery

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

120<br />

<strong>Getting</strong> Started with <strong>pureQuery</strong><br />

6.6.2.2 Changes to statement sets<br />

When you configure a <strong>pureQuery</strong>Xml file that has previously been configured, the default<br />

behavior of the Configure utility is to attempt to preserve how statements are grouped into<br />

statement sets by processing only the statement sets that need to be processed. You can<br />

specify the option -cleanConfigure with the value TRUE to direct <strong>pureQuery</strong> to process<br />

all of the statements without attempting to preserve their groupings.<br />

In a <strong>pureQuery</strong>Xml file, each statementSet element has a configureStatus attribute<br />

that is set to REQUIRED, AUTO, or FINAL. These values dictate how the Configure utility<br />

treats the statement sets. The utility does not configure a statement set for which the<br />

configure status is FINAL, if the statement set has a base package name. The utility only<br />

configures AUTO packages when necessary, and it always configures REQUIRED<br />

packages. When you specify the option -cleanConfigure with the value TRUE to the<br />

Configure utility, the utility makes no attempt to preserve the groupings of the statements in<br />

the file. It configures all of the SQL statements and creates new statement sets to contain<br />

them.<br />

If you manually edit a statement set, you must change the configureStatus to<br />

REQUIRED. Otherwise, the Configure utility might not configure the statement set, and its<br />

resulting contents could be invalid. When the Configure utility configures a statement set, it<br />

performs some checks on the contents of the statement set, and it stores information in the<br />

statement set that the StaticBinder utility needs to bind the packages. Changes to the<br />

contents of a statement set can result in changes to the information necessary to bind the<br />

package correctly. IBM recommends that you only modify <strong>pureQuery</strong>Xml files by<br />

capturing, by configuring, and by using the IBM Optim Development Studio <strong>pureQuery</strong>XML<br />

editor. Doing so causes the configureStatus attribute to be managed appropriately,<br />

and it otherwise helps to keep the contents of the file in a legal state.<br />

6.6.3 DDL statements<br />

DDL statements can cause problems in applications that execute SQL statically. When an<br />

application runs DDL statements that modify tables or other database objects, the IBM ®<br />

DB2 Database automatically invalidates any packages that reference those database<br />

objects. If the application then attempts to execute an SQL statement in an invalidated<br />

package, the database automatically tries to re-bind the package. The access plans that<br />

the re-bind uses can be different from those of the original package, and they might be less<br />

optimal than the original plans. Consequently, if your application runs DDL statements,<br />

you should review the SQL statements to determine if they will cause problems for the<br />

database packages that your application will use.<br />

The Configure utility puts DDL statements and non-DDL statements into separate<br />

statement sets. It also generates a separate file with the extension .ddl that contains the<br />

DDL statements that are in the file. This file can help you to determine which DDL<br />

statements your application executes, and you can use it to know the SQL statements that

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

Saved successfully!

Ooh no, something went wrong!