So, which comes first?
That's always the quandary.
Especially when you want to start to populate a PPDM database without turning off any constraints. Do you populate the R_SOURCE table first? But then, how can you put a value in the Row_Quality column? Okay, so then let's populate the R_PPDM_ROW_QUALITY table first. And you are going to put what in the Source column?
So, which comes first?
Well, it really does not matter. If you take a bit of time, you can populate these two tables with a couple of SQL statements, without disabling constraints. How do you do it? Well, lets find out. Say I wanted to store PPDM and dMCI as sources with REAL, DERIVED & NOT CLASSIFIED as row quality values. One way is:
- store PPDM as a source, without a row quality or source value
- store REAL & NOT CLASSIFIED as row quality with the source of PPDM
- update the row quality value in the row in the source table to REAL
- add dMCI as a source, with a row quality of NOT CLASSIFIED and source of PPDM
- add DERIVED as row quality with the source of dMCI
There you have it. From this, you should be able to build on populating your database. That's all there is to it. You could also start with populating the row quality table first; just make sure that you don't put anything into the source column in the initial insert. You have to update it later.
There are several other tables in PPDM that have this type of relationships. You just have to slow down, think about it and realize that it will take a couple of statements to make it happen.
Now, back to that chicken....
Comments