Copy data between DWs/DSs

Share this topic:



Link to this posting

Postby Ursego » 04 Mar 2013, 15:45

Data can be copied from one DW/DS to another in a very simple way:

Code: Select all
<target DW or DS>.object.data = <source DW or DS>.object.data

But there are a few potential issues in that approach which force us to dilute our business logic with some boring technical code. So, we need to:

1. Ensure that the source DW/DS is valid.
2. Ensure that the target DW is valid.
3. Create the target DS if it is not valid.
4. Reset() the target DW/DS.
5. Copy the DataObject from the source to the target.
6. Make sure there is at least one row to copy. If the source has no rows then a runtime error occurs!

All those problems are solved in a small autoinstantiated NVO n_copy_data which is downloadable here. It has four overloaded functions uf_from_to(<source DW or DS>, <target DW or DS>). If you want to add these function to another NVO (or to your ancestor DW/DS) then change their name to uf_copy_data_from_to (the name uf_from_to makes sense only in n_copy_data, like lnv_copy_data.uf_from_to...).
User avatar
Ursego
Site Admin
 
Posts: 112
Joined: 19 Feb 2013, 20:33

Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest


Copy data between DWs/DSs

Share this topic:


If you think that this site is not too bad, please LIKE it in Facebook. Thanks!





cron
free counters

eXTReMe Tracker