onComplete transform map script

Chandu12
Mega Expert

Hi Experts,

Could someone help me in my requirement.

We have a Informatica load(Weekly), we need to implement clean-up logic for the staging table ex:(u_master_load).

The logic is the following: If a load is completed successfully (no errors), the staging table records should be deleted so that only the current and the last successful load remain.

Ex:-1) ISET013001, 2) ISET013002 3) ISET013003 4) ISET013004

We have 4 import set out of that i have to keep the current import set and the previous import set, apart from that need to delete other records in the staging table which are completed.

Logic implemented: Oncomplete script, need to implement using the objects (log, source etc). Please help me in the coding part.

Regards,

Chalan

 

1 ACCEPTED SOLUTION

I disagree that you need to keep this level of detail on your import set tables. They'll be cleaned as necessary.

Part of the beauty of using a cloud service like ServiceNow is that you don't have to worry about storage so much. 103K records is not that big of a deal for us.

If you have other concerns, let me know, but wouldn't bother writing something custom to maintain import tables when you don't have to.

View solution in original post

8 REPLIES 8

Hi Martin,

 

It would be great that if you can share your code which you have implemented using "importsetcleaner" Script Include.

 

Regards,
Chalan

Something like the below.  As I mentioned, the code is in your instance, in the Scheduled Cleanup link in the left nav.  The only changes is adding your table name, and changing the number of days to meet your requirements.

 

var ic = new ImportSetCleaner('u_master_load');

ic.setDays(1);

ic.clean();

 

 

Yadin
Tera Contributor

I thought maybe I'd finally found the answer for what should be a simple operation in a scheduled data import, but alas this does not work.  I'm baffled why it's so hard to tell this software to clean out the old import table before pulling in a fresh import.  I mean, it should do that automatically by default really, why would I want it to constantly trip over old data?

What issue are you having with it and/or the import tables?  This continues to work for us, and keeping 3 days overall for the other imports has given us some buffer for troubleshooting.