The StaticBinder utility always processes the entries in
options files in the order in which they are listed. If an options
file contains both an entry for a statement set in a pureQueryXML
file and an entry for that entire pureQueryXML file, the order in
which the entries appear determines the output for those entries.
An entry for a statement set looks like this:
file.pdqxml:base-package-name
The base name of the package
is the value of the
name attribute of the
package element
that describes the package in the
pureQueryXML file.
The base name consists of two parts:
- The root package name
- Any characters that the Configure utility appended
to the root package name because of the value of the sqlLimit option
when the Configure utility last processed the pureQueryXML file
The
examples in the next two sections use the following objects:
- captureFile.pdqxml
- This pureQueryXML file contains four statement sets with the following
base package names: PKGA, PKGB, PKGC, and PKGD. Each of the statement
sets contains SQL statements that use the table TABLE1. In all of
these SQL statements, TABLE1 is referenced as TABLE1, not as schema-name.TABLE1.
Each entry in the options file uses the -bindOptions option to specify
the QUALIFIER option, which determines the schema name for tables
that are referenced without schema names.
- captureFile.pdqxml:PKGA
- This statement set requires particular options, and so it has
a separate entry in the options file.
For these examples, recall that when you bind
a statement set without specifying an isolation level, the StaticBinder
utility creates four packages, one package for each isolation level.
Suppose that you ran the StaticBinder on PKGF, but you did not specify
an isolation level. The StaticBinder utility would create the packages
PKGF1, PKGF2, PKGF3, and PKGF4, each appended number indicating the
isolation level for the package.
Examples that result in one version of PKGD
- In this example, the StaticBinder utility first binds all of the
statement sets in pureQueryXML file captureFile.pdqxml with the qualifier
TESTSCHEMA. This includes the statement set with the base package
name PKGA. The StaticBinder utility then binds the statement set with
the base package name PKGA again, but this time using the qualifier
PRODUCTIONSCHEMA. The packages bound for the second entry replace
the packages of the same name that were bound for the first entry.
C:\dir\captureFile.pdqxml = -bindOptions "QUALIFIER TESTSCHEMA"
C:\dir\captureFile.pdqxml:PKGA = -bindOptions "QUALIFIER PRODUCTIONSCHEMA"
Final
result:
- Packages that use PRODUCTIONSCHEMA.TABLE1: PKGA1, PKGA2, PKGA3,
PKGA4
- Packages that use TESTSCHEMA.TABLE1: PKGB1, PKGB2, PKGB3, PKGB4,
PKGC1, PKGC2, PKGC3, PKGC4, PKGD1, PKGD2, PKGD3, PKGD4
- In this example, the StaticBinder utility binds the packages associated
with the base package name PKGA with the qualifier PRODUCTIONSCHEMA,
and then binds all of the packages in captureFile.pdqxml with the
qualifier TESTSCHEMA. The packages bound for the second entry replace
the packages of the same name that were bound for the first entry.
C:\dir\captureFile.pdqxml:PKGA = -bindOptions "QUALIFIER PRODUCTIONSCHEMA"
C:\dir\captureFile.pdqxml = -bindOptions "QUALIFIER TESTSCHEMA"
Final
result:
- No packages use PRODUCTIONSCHEMA.TABLE1
- Packages that use TESTSCHEMA.TABLE1: PKGA1, PKGA2, PKGA3, PKGA4,
PKGB1, PKGB2, PKGB3, PKGB4, PKGC1, PKGC2, PKGC3, PKGC4, PKGD1, PKGD2,
PKGD3, PKGD4
However, you can use the -differenceOnly option
on the second line to prevent the StaticBinder utility from binding
PKGA again. The StaticBinder does not rebind those packages because
packages already exist in the database with the same collection name,
package name, and consistency token.
C:\dir\captureFile.pdqxml:PKGA = -bindOptions "QUALIFIER PRODUCTIONSCHEMA"
C:\dir\captureFile.pdqxml = -bindOptions "QUALIFIER TESTSCHEMA" -differenceOnly TRUE
Final
result:
- Packages that use PRODUCTIONSCHEMA.TABLE1: PKGA1, PKGA2, PKGA3,
PKGA4
- Packages that use TESTSCHEMA.TABLE1: PKGB1, PKGB2, PKGB3, PKGB4,
PKGC1, PKGC2, PKGC3, PKGC4, PKGD1, PKGD2, PKGD3, PKGD4
Examples that result in two versions of PKGD
- In this example, the StaticBinder utility first processes all
of the statement sets in pureQueryXML file captureFile.pdqxml, which
includes the statement set with the base package name PKGA. The StaticBinder
binds four packages at the Uncommitted Read isolation level, appending
the number 1 to each package name. The StaticBinder utility then binds
the package PKGA again, but this time using Cursor Stability as the
isolation level. The utility appends the number 2 to the package name.
C:\dir\captureFile.pdqxml = -isolationLevel UR
C:\dir\captureFile.pdqxml:PKGA = -isolationLevel CS
Final
result:
- PKGA1, PKGB1, PKGC1, PKGD1
- PKGA2
- This example binds the package PKGA with the isolation level Cursor
Stability, and then binds all of the packages in captureFile.pdqxml
with the isolation level Uncommitted Read.
C:\dir\captureFile.pdqxml:PKGA = -bindOptions "QUALIFIER PRODUCTIONSCHEMA"
C:\dir\captureFile.pdqxml = -bindOptions "QUALIFIER TESTSCHEMA"
Final
result:
- Package that uses PRODUCTIONSCHEMA.TABLE 1: PKGA2
- Packages that use TESTSCHEMA.TABLE1: PKGA1, PKGB1, PKGC1, PKGD1
However, you can use the -differenceOnly option
on the second line to prevent the StaticBinder utility from binding
PKGA again. The StaticBinder does not rebind those packages because
packages already exist in the database with the same collection name,
package name, and consistency token.
C:\dir\captureFile.pdqxml:PKGD = -bindOptions "QUALIFIER PRODUCTIONSCHEMA"
C:\dir\captureFile.pdqxml = -bindOptions "QUALIFIER TESTSCHEMA" -differenceOnly TRUE
Final
result:
- Package that uses PRODUCTIONSCHEMA.TABLE 1: PKGA2
- Packages that use TESTSCHEMA.TABLE1: PKGB1, PKGC1, PKGD1