cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Copy snap creating output that is multiplied by number of records

clarrivey
New Contributor

I have a pipeline that creates files based upon 490 records in an Oracle table. I create the output by doing a select on static headings that I create and union it with actual records from the table and then I sftp the file. I wanted to also be able to email the file, so snapLogic support suggested adding a Copy snap and sending one to sftp and the other to email, so I added a Copy snap right after the Oracle Execute snap that then went to a CSV Formatter snap and then to a File Writer snap to sftp. The copy also went to a CSV Formatter and then a File Writer to create a file in my directory and finally an email snap to send the file. All of this worked EXCEPT that the listing I received was 491 records (which included a header) TIMES 490!!! For whatever reason, it repeated the copy 490 times!!! Any ideas as to why???

17 REPLIES 17

I agree - the copy SHOULD do no more than just that (but maybe itโ€™s doing more???)!!!
Iโ€™m rather a newbie at this, so what is the slp file and how do I access/send it???

koryknick
Employee
Employee

@clarrivey - Iโ€™m assuming that the Oracle Insert is receiving multiple records. Further, if you look in the Dashboard, I would guess that you will see the Oracle - Execute Update SWEADTE snap is executing 490 times, and the Oracle - Execute3 is executing 490 times as well, pushing a great deal more data to the Copy and remaining downstream snaps than you are expecting.

My recommendation is that you either:

  1. Split this pipeline into two parts such that the first ends after the Oracle Insert snap
    -OR-
  2. Add a Tail snap after the Oracle Insert to wait for the upstream input to complete before moving on to the Oracle - Execute Update SWEADTE and other downstream snaps

Kory,
Here is the sql for the Oracle - Execute3:
select โ€˜ReferenceCodeโ€™||chr(09)||โ€˜FirstNameโ€™||chr(09)||โ€˜LastNameโ€™||chr(09)||โ€˜Statusโ€™||chr(09)||โ€˜Genderโ€™||chr(09)||โ€˜RefreshGroupโ€™||chr(09)||โ€˜ContactTypeโ€™||chr(09)||โ€˜HomePhoneโ€™||chr(09)||โ€˜PrimaryPhoneโ€™||chr(09)||โ€˜TTYPhoneโ€™||chr(09)||โ€˜EmailAddressโ€™||chr(09)||โ€˜EmailAddressAltโ€™||chr(09)||โ€˜SMSPhoneโ€™||chr(09)||โ€˜Institutionโ€™
from sys.dual
union
select
rtrim(id)||chr(09)||
rtrim(fname)||chr(09)||
rtrim(lname)||chr(09)||
rtrim(ecls_code)||chr(09)||
rtrim(gender)||chr(09)||
rtrim(dept)||chr(09)||
rtrim(contact_type)||chr(09)||
rtrim(hr_phone)||chr(09)||
rtrim(primary_phone)||chr(09)||
rtrim(tty_phone)||chr(09)||
rtrim(ca_email)||chr(09)||
rtrim(primary_email)||chr(09)||
rtrim(sms_phone)||chr(09)||
โ€˜WHEATON COLLEGEโ€™
from sweadte
When I run it in sql (via TOAD), I get 491 output records. THAT is what I would expect to be in my Copy! I understand that Oracle - Execute Update SWEADTE snap is updating 490 records, but I donโ€™t really understand what you mean that they are โ€œpushing a great deal more data to the Copyโ€ฆโ€? Please forgive my ignorance, but I thought the snaps executed in order (i.e. 2nd one didnโ€™t run until 1st one was complete). It doesnโ€™t make any sense to me to split the pipeline - it SHOULD be able to handle it! And Iโ€™m also not sure I fully understand the significance of a Tail snap, so I will have to look that up in the documentation.

One other quick question: in the View(s), you have things like input0 and output0. Can these stay the same throughout the pipeline, or do they need to be updated?