Copy data between DWs/DSs


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 is a potential issue in that approach which forces us to dilute our business logic with some boring technical code: if the source has no rows, then a runtime error occurs when you grab <source DW or DS>.object.data. That problem is 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>). They make sure that there is at least one row to copy.

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 is understandable only in the context of n_copy_data, like lnv_copy_data.uf_from_to...).
User avatar
Ursego
Site Admin
 
Posts: 143
Joined: 19 Feb 2013, 20:33



Ketones are a more high-octane fuel for your brain than glucose. Become a biohacker and upgrade yourself to version 2.0!



cron
Traffic Counter

eXTReMe Tracker