Table of Contents

Search

  1. Preface
  2. Introduction to Data Validation Option
  3. New Features and Behavior Changes
  4. Repositories
  5. XML Data Source
  6. Tests for XML Data Sources
  7. Connections
  8. Expressions
  9. Table Pairs
  10. Tests for Table Pairs
  11. Single-Table Constraints
  12. Tests for Single-Table Constraints
  13. Examples of Tests from Spreadsheets
  14. SQL Views
  15. Lookup Views
  16. Join Views
  17. Aggregate Views
  18. Business Intelligence and Reporting Tools Reports
  19. Dashboards
  20. DVOCmd Command Line Program
  21. Troubleshooting
  22. Datatype Reference
  23. Reporting Views
  24. Metadata Import Syntax
  25. Jasper Reports
  26. Glossary

Data Validation Option User Guide

Data Validation Option User Guide

Column Comparison by Position

Column Comparison by Position

You can generate table-pair tests that compare columns by position. Compare columns by position when the order of the columns in the two tables are the same.
If one table contains extra columns, you can skip the first columns of one table when you compare columns by position. For example, the first column in Table A matches the second column in Table B, and the second column in Table A matches the third column in Table B. To match the columns by position, you can skip the first column in Table B.
The following examples describe scenarios when you compare columns by position:
Table pair with tables that have the same number of columns and different names
For example, you have SampleA as Table A and SampleB as Table B in a table pair.
The following table lists the columns in SampleA and SampleB:
SampleA
SampleB
column1
col1
column2
col2
column3
col3
To compare column1, column2, and column3 in SampleA with col1, col2, and col3 in SampleB, respectively, compare the columns by position. Do not skip any columns in Table A or Table B.
Table pair with tables that have a different number of columns
For example, you have SampleA as Table A and SampleB as Table B in a table pair.
The following table lists the columns in SampleA and SampleB:
SampleA
SampleB
column1
col1
column2
col2
column3
col3
-
column1
-
column2
-
column3
To compare column1, column2, and column3 in SampleA with column1, column2, and column3 in SampleB, respectively, compare the columns by position. Skip three columns in Table B.
Table Pair with an SQL View and a Table
For example, you have an SQL view named sample_view that is based on Table1 and Table2. You also have a table named Table3. In the table pair, you define sample_view as Table A and Table3 as Table B.
The following table lists the columns in sample_view and Table3:
sample_view Columns
Table3 Columns
Table1.columnA
column1
Table1.columnB
column2
Table2.columnC
-
Table2.columnD
-
To compare Table2.columnC and Table2.columnD with column1 and column2 of Table3, respectively, compare the columns by position. Skip the first two columns in sample_view.