This topic contains the following sections:
There are two ways that you can merge pureQueryXML files.
If you must edit a pureQueryXML file outside of the workbench, in the <statementSet> tag of the statement set in which an edit occurs set the value of the configureStatus attribute to REQUIRED, like this: configureStatus="REQUIRED" Then, run the Configure utility on the file.
For Java™ applications, you run the Configure utility on capture.pdqxml, so that the Configure utility can name the statement sets. You then give copies of this file to other members of your team so that they can incrementally capture statements from other logical paths in the same application. Each member uses their copy as an input file, specifying the file as the value of the pureQueryXml property. Each member sets the value of the outputPureQueryXml property to the name of the file to contain the additional SQL statements that they capture. Those team members give you their output files, which you run the Merge utility on to create a new file that contains the SQL statements from the files that contributed to the merge. If you open the new file, you see that it still contains the statement sets that were in the base file. The SQL statements from the output files that your team members gave you are in a new, unnamed statement set that is at the end of the new file.
In the file that results from the merge, the Merge utility combines the SQL statements from all of the pureQueryXML files into a single, unnamed statement set.
(1) >>-------java com.ibm.pdq.tools.Merge--+------------------+-----> '- -baseFile--file-' .------. V | >--+- -inputPureQueryXml----file-+--+---------------------------> '- -inputPureQueryXmlGroup--file-' >-- -outputPureQueryXml--file--+-----------------------+--------> | (2) | '-| Trace options |-----' >--+--------------------------+---------------------------------> | .-FALSE-. | '- -showDetails--+-TRUE--+-' >--+--------------------------------------+---------------------> '- -removeSQLInactiveForDays----days---' >--+--------------------------+--+--------+-------------------->< | .-FALSE-. | '- -help-' '- -validateXml--+-TRUE--+-'
To understand the conventions that are used in the diagram, see How to read syntax diagrams.
If an SQL statement in one of the files that you merge together performs positioned updates, and the statement that declares the cursor for those positioned updates is not in the same file, the Merge utility looks for the declaration of the cursor in the files that you are merging.
For example, suppose that you captured SQL statements from a clustered Web application and produced the three pureQueryXML files A, B, and C. For the merge process, you use file C as the base file. File A contains SQL statement S1, which performs a positioned update. However, file A does not contain SQL statement S2, which declares the cursor that S1 uses. Therefore, the Merge utility looks in files B and C for an SQL statement that declares this cursor. If such a statement does not exist in files B or C, the Merge utility does not merge the positioned update statement S1, and a logs a warning.
If you do not specify a base file, in the file that results from the merge the Merge utility combines the SQL statements from all of the pureQueryXML files into a single, unnamed statement set.
If the path or name of a file contains a space, enclose the entire entry for the file in quotation marks.
To specify multiple files, the file name can contain the * wildcard character.
For example, if the days variable is 5, and the current date is 11/25, November 25, SQL statements with a timestamp 11/20, November 20 and earlier, are not written.
If the SQL statement does not have a timestamp, the SQL statement is written to the output file with timestamp information using the current time. For example, if a previous version of a pureQueryXML file is an input file, a SQL statement does not have a timestamp. For a previous version of a pureQueryXML file, version 3 or earlier, the option is ignored, all SQL statements are written to the output file with the current time timestamp, and a message is displayed.
If the statement set has a configureStatus of FINAL, statements that meet the criteria for inactive days are written to the output pureQueryXML file, and the Merge utility writes a message to the log file with the statement and reason for keeping the statement.
A message is written to the log file for the SQL statements that are not written to the output pureQueryXML file. If the -showDetails option is true, all of the statements that have not been written to the output file are displayed.
>>-+------------------------+--+---------------------------+--->< '- -traceFile--file-name-' | .-OFF-----. | '- -traceLevel--+-ALL-----+-' +-SEVERE--+ +-WARNING-+ +-INFO----+ +-CONFIG--+ +-FINE----+ +-FINER---+ '-FINEST--'
If the file already exists, pureQuery® appends new messages to the existing content of the file. As the default, the entries are written to System.err.
If a pureQueryXML file fails XML schema validation, the merge operation fails. The file name and error that caused the schema validation failure will be reported. Subsequent files will not be validated. The first validation error is reported and the merge failure is reported.
Only current release or previous version pureQueryXML files are validated (version 4 or 3). If an earlier version of pureQueryXML is detected, validation is not performed on that file.
The attribute is not replaced if the value in STMT_A is already true or the value in STMT_B is either false or an empty string ("").
If a user defined cursor name is in another input file later in the merge process, it is ignored.
Moreover, if two statements in different pureQueryXML files are identical in every respect except for their stack trace entries, the differing stack trace entries are combined for the resulting single statement in the file that results from the merge.
The Merge utility sets the value in the merged file to the value specified in last input file that has the value of the sqlLiteralSubstitution attribute set to DISABLE or ENABLE.
If value of the XML attribute sqlLiteralSubstitution is set to DISABLE in one or more input files and set to ENABLE in other input files, the utility displays a warning message.