# Staged to target check in testframework

**URL:** <https://forum.data-community.org/t/staged-to-target-check-in-testframework/1824>\
**Category:** Data Vault 2.0\
**Created:** [April 16, 2025, 8:45am UTC](https://forum.data-community.org/t/staged-to-target-check-in-testframework/1824 "2025-04-16T08:45:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![frank\_boekamp](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@frank\_boekamp](https://forum.data-community.org/u/frank_boekamp)\
**Post date:** [April 16, 2025, 8:45am UTC](https://forum.data-community.org/t/staged-to-target-check-in-testframework/1824/1 "2025-04-16T08:45:48Z")

</div>

We are building the test framework described in the book “The Data Vault Guru”. We have an issue with the supplied SQL code of the “Staged to target check” of SKEY and BKEY. For example on page 418 the SQL code of HUB\_SKEY\_SGTG: the last line of the SQL code in the book is:

and h.DV\_HASHKEY\_{{HUB-TABLENAME}} is null

This code is not working correctly in Oracle at our site. If we substitute the code with following line it is working correctly:

where h.DV\_HASHKEY\_{{HUB-TABLENAME}} is null

In the Orphan checks a similar line of code is using where instead of and.

Is this a glitch in the code or are some DBMS’es capable of using that code?

---

<div class="post-metadata">

**Author:** ![patrickcuba](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/patrickcuba/32/19_2.png) [@patrickcuba](https://forum.data-community.org/u/patrickcuba)\
**Post date:** [April 16, 2025, 3:37pm UTC](https://forum.data-community.org/t/staged-to-target-check-in-testframework/1824/2 "2025-04-16T15:37:03Z")

</div>

I built those based on a platform I was working on that is ANSI-SQL compliant  
If you need to _adjust_ those queries to suit your needs… you have my permission to do so.  
I think I highlight that point in the book also, a lot of the RI tests “prove” that the DV model is “in-tact”. And later in the same chapter I discount a lot of the tests if the features are natively supported by the platform.

I hope that makes sense.

---

<div class="post-metadata">

**Author:** ![frank\_boekamp](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@frank\_boekamp](https://forum.data-community.org/u/frank_boekamp)\
**Post date:** [April 17, 2025, 6:15am UTC](https://forum.data-community.org/t/staged-to-target-check-in-testframework/1824/3 "2025-04-17T06:15:19Z")

</div>

Thanks, it makes sense. Oracle has deviations from ANSI SQL so we adjust where needed.

We have build all tests in the test framework. We are planning not to set any constraints in the database. We insert the testresults to a common table to store the testresults. We added one extra test: ‘number of rows \> 0’ and keep track of the count(\*).

We already have found some data quality issues and an initial load issue with our first data source. It’s a very powerfull tool. I think we will also build a data profiling tool like this to be able to analyze data during the design phase.

---

<div class="post-metadata">

**Author:** ![patrickcuba](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.data-community.org/patrickcuba/32/19_2.png) [@patrickcuba](https://forum.data-community.org/u/patrickcuba)\
**Post date:** [April 17, 2025, 8:39am UTC](https://forum.data-community.org/t/staged-to-target-check-in-testframework/1824/4 "2025-04-17T08:39:02Z")

</div>

you could extend this framework for recon, although built in Snowflake you could adapt this to anything and throw a dashboard on top of it

> **[the\_data\_must\_flow/data-auto-testing at master · PatrickCuba/the\_data\_must\_flow](https://github.com/PatrickCuba/the_data_must_flow/tree/master/data-auto-testing)**
>
> Contribute to PatrickCuba/the\_data\_must\_flow development by creating an account on GitHub.

I also did an extension to the framework here: [What is the Shape of your Data?. … and why is it important. | by Patrick Cuba | The Modern Scientist | Medium](https://medium.com/the-modern-scientist/what-is-the-shape-of-your-data-0a146c6eb145)
