Skip to main content
Question

Pipeline to Pre-fill a many to many table triggered by the addition of Parent Records

  • January 20, 2022
  • 0 replies
  • 33 views

Forum|alt.badge.img+6
I have a many to many table that includes a distance value between 2 related parent table records. When either a Parent 1 or Parent 2 record is added I want to create a record in the many to many table ... result being that for each Parent 2 there will be distance for Parent 1. Currently there are 300 records in Parent 1 and 60 records in Parent 2.  I have manually imported from a csv 18000 records in to the many to many table. 

What does the pipeline look like that creates additonal records automatically when either a Parent 1 or Parent 2 record is added.

------------------------------
George Bramhall
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
It will be two separate pipelines.

Pipeline 1
Trigger on Parent 1 Created.
Create a bulk upsert
Search all Table B Records.
For each loop - add upsert row (creating those middle join records) 
Then outside the loop .. commit upsert.

Then similar but opposite for Parent 2 created.

------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------