Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : DIFF_DATA

DIFF_DATA
Compares the data of two tables or table instances and lists the differences. (F)
Invocation
differences = DIFF_DATA(table1, field1, location1, selection1, table2, field2, location2, selection2, printresult)
 
On return, contains N if there are no differences and Y if there are any differences. The actual differences, if any, are listed in the message log.
Specific fields within table1 to compare. Valid values are:
fieldnames – Indicates the comparison is based on primary key values and the fields specified in field1 and field2. Specify a series of fieldnames in the format: fieldname fieldname fieldname.
The name of the node where table1 is located.
A selection string used to designate which occurrences in table1 are to be used for comparison. Valid operators are:
Specific fields within table2 to compare. Valid values are the same as for field1.
A selection string used to designate which occurrences in table2 are to be used for comparison. Valid operators are the same as for selection1.
Usage Notes
If the tables specified in table1 and table2 are parameterized, specify only the data parameters, not the location parameters.
Values for location1 and location2 are specified only if the tables are located on different nodes.
In the output, the letters D and I indicate which items are to be deleted or inserted to make the specified data of table2 match the specified data of table1.

Exceptions
 
Example
This example compares the primary key fields and the DEPTNO fields within each occurrence and returns the results of the comparison to the message log:

 
RULE EDITOR ===> SCROLL: P
DIFF_DATA_1;
_ LOCAL DIFFERENCES;
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ DIFFERENCES = DIFF_DATA('EMPLOYEES(MIDWEST)', 'DEPTNO', '' | 1
_ , '', 'EMPLOYEES(CANADA)', 'DEPTNO', '', '', 'Y'); |
_ ---------------------------------------------------------------------------

 
Extract of the Results
The results indicate the changes that should be made to the tables to make the data the same:

 
COMMAND ===> SCROLL ===> P
SOURCE TABLE C KEYFIELD (EMPNO) REASON
-------------------------- - --------------------------- ----------------------
EMPLOYEES(MIDWEST) D 22001
...
EMPLOYEES(MIDWEST) D 41007
EMPLOYEES(MIDWEST) D 41009 (DEPTNO) = 50
EMPLOYEES(MIDWEST) D 44385
EMPLOYEES(MIDWEST) D 44622 (DEPTNO) = 40
EMPLOYEES(MIDWEST) D 61622
.
EMPLOYEES(CANADA) I 32001
EMPLOYEES(CANADA) I 32007
EMPLOYEES(CANADA) I 40058
EMPLOYEES(CANADA) I 41009 (DEPTNO) = 150
...

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved