View previous topic :: View next topic
|
Author |
Message |
juananand
New User
Joined: 07 Jan 2009 Posts: 2 Location: New York
|
|
|
|
I have a requirement as follows:
Copy the table A data in 1st DB2 region to the table A data in 2nd DB2 region.
Now Table A has the say four columns
Column 1 ,Column2 ,Column3, Column4. Now the value for the Column 1 is populated by Sequence Object SR1 that resides in both 1st DB2 region and the 2nd DB2 region and generates numbers in their own region.
When I copy the data of table a from 1st DB2 Region to 2nd db2 region apart from the column 1 (which is generated by Sequence object SR1) the rest of the values can be same.
I thought of one option to do this (though I am not sure)
1) Unload the data of Table A in 1st DB2 region into a data set
2) Edit the dataset by replacing the Column 1 values with an sql script that generates the next value of the sequence object
3) Transfer the data set from 1st DB2 region to 2nd DB2 region using NDM utility
4) Load the data into the Table A in the 2nd region from the data set.
Now my question is when Loading would it execute the sql script to generate the next value of the Sequence object SR1 pertaining to the 2nd region.
Is there any other way (other than a program that reads the dataset and inserts into the table in which I could use the generation of the next value of Sequence object and insert the record)?..
Please suggest |
|
Back to top |
|
|
jaspal
New User
Joined: 22 May 2007 Posts: 68 Location: mumbai
|
|
|
|
Hi ,
Could you please add-on some more details i.e Definition of table .... what i got is you have table1 in X region with defintion of auto generating key sequence and same table in Y region and you have some records in X region table which when inserted created an autogenerated key.
Now you want to insert all the records from X region table into Y region table wherein the autogenrarted key of X table should be key of Y region table i.e in Y region table no key should be autogenerated itself.
Thanks,
Jaspal Virk |
|
Back to top |
|
|
juananand
New User
Joined: 07 Jan 2009 Posts: 2 Location: New York
|
|
|
|
Hi Jaspal,
You have partly correct in your understanding of the requirement. To give a better explanation I give the project scenario
Currently the user has to populate the value for the Table A (through application) in region X and again has to populate the value for the Table A (through application) in region Y. The business requirement is to reduce this duplicate effort such that now the user is enough to populate the value for the Table A (through application) in region X and request to have the value populated for the Table A in Region Y.
Now currently when the user initiates the population of the value for the Table A in region X the program P1 that does the population generates the value for Column1 using the Sequence object SR1 pertaining to X region.
Again when the user inititate the population of the same value for table A in region Y the program P1 (Same program residing in Y region) that does the population generates the value for Column1 using the Sequence object SR1 pertaining to Y region. So except the column1 value (since it is generated by the Sequence Object SR1 that resides in X and Y region) the rest of the column values are same in Table A in both regions X and Y.
Therefore as per the new requirement (where the user populates the value only in X region and request to populate the same value in Y region) the same output must be achieved i.e. excluding the column 1 (which is populated using Sequence Object SR1) the rest of the column values should be same in Table A in both region X and Y. |
|
Back to top |
|
|
|