If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Test data generation with dynamic keys

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-05, 11:00
lintpete lintpete is offline
Registered User
 
Join Date: Oct 2005
Posts: 1
Question Test data generation with dynamic keys

Hi everybody!

Can you advice me on the following:

I want to create test data in a test environment by extracting a selection from production data (all related data). Certain tables however have dynamic key fields (the value of a dynamic key field is assigned by db2 upon creation of the row). When adding these records to the table of the test environment the dynamic key fields will have to be recalculated in order to prevent gaps or duplicate keys. Furthermore: other tables are also copied from production because a consistent set is copied. Because the table with the dynamic key field is referenced, the newly calculated value of the dynamic key field will have to be entered in these tables .

Am I correct in these assumptions?
How to perform this operation?

Thanx!
Reply With Quote
  #2 (permalink)  
Old 10-06-05, 11:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I assume that by "dynamic key fields" youu mean identity columns. If this is the case, create the tables in you test environment with identity columns as "Generated by default" instead of "generated always" This will allow you to insert the data without having to change all the identity columns and all the FK values that pint to them. Also, you will need to set the starting value on you identity column on your test system to something much greater than what you expect your production environment to contain. This will prevent your test system generating values that are duplicate of the production values.

HTH

Andy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On