Including dynamic parameters on test query

9 views
Skip to first unread message

Kabilan Ganesan

unread,
Mar 10, 2020, 10:54:53 AM3/10/20
to dbfit
Dear Guys,

We are trying to test "Source to Target" DB testing. So its always the case not all source records gets loaded into target DB.

My first test case will be to find the missing records in Target DB. All proceeding test cases will be to check the other column values for the records made it into Target DB.

For this, I would like to exclude the missing primary keys on my Source Query to avoid failing of all proceeding test cases.

Here is a simple example what is expected.

Eg:

Source DB      |    Target DB
PrimaryKey 1   |    PrimaryKey 1
PrimaryKey 2   |   
PrimaryKey 3   |    PrimaryKey 3
PrimaryKey 4   |   
PrimaryKey 5   |    PrimaryKey 5

My First query will list me values PrimaryKey 2 and PrimaryKey 4
My source DB query on proceeding test cases should be like

SELECT Col1, Col2
FROM Table1
WHERE NOT EXISTS(PrimaryKey 2, PrimaryKey 4)
Note: Number of records that need to be excluded is dynamic and will change on every load and different tables.

Can someone help me how I can include this dynamic parameter to exclude records?
Reply all
Reply to author
Forward
0 new messages