Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I put together a sample <a href="https://dl.dropboxusercontent.com/u/27024221/stackoverflow.ktr" rel="noreferrer">transformation(right click and choose save link)</a> based on what you provided. The only step I feel a bit uncertain on is the last table inputs. I'm basically writing the join data to the table and letting it fail if a specific relationship already exists. </p> <h3>note:</h3> <p>This solution doesn't really meet the "All approaches should include some from of validation and a rollback strategy should an insert fail, or fail to maintain referential integrity." criteria, though it probably won't fail. If you really want to setup something complex we can but this should definitely get you going with these transformations.</p> <p><img src="https://i.stack.imgur.com/WRbLq.png" alt="alt text"></p> <h2>Dataflow by Step</h2> <p><strong>1.</strong> We start with reading in your file. In my case I converted it to CSV but tab is fine too. <img src="https://i.stack.imgur.com/TnMvM.png" alt="alt text"></p> <p><strong>2.</strong> Now we're going to insert the employee names into the Employee table using a <code>combination lookup/update</code>. After the insert we append the employee_id to our datastream as <code>id</code> and remove the <code>EmployeeName</code> from the data stream. </p> <p><img src="https://i.stack.imgur.com/YHNqT.png" alt="alt text"></p> <p><strong>3.</strong> Here we're just using a Select Values step to rename the <code>id</code> field to employee_id <img src="https://i.stack.imgur.com/VBwAe.png" alt="alt text"></p> <p><strong>4.</strong> Insert Job Titles just like we did employees and append the title id to our datastream also deleting the <code>JobLevelHistory</code> from the datastream.</p> <p><img src="https://i.stack.imgur.com/aXFsd.png" alt="alt text"></p> <p><strong>5.</strong> Simple rename of the title id to title_id(see step 3) <img src="https://i.stack.imgur.com/66Wjx.png" alt="alt text"></p> <p><strong>6.</strong> Insert offices, get id's, remove OfficeHistory from the stream.</p> <p><img src="https://i.stack.imgur.com/xwW0g.png" alt="alt text"></p> <p><strong>7.</strong> Simple rename of the office id to office_id(see step 3)</p> <p><img src="https://i.stack.imgur.com/oMPrx.png" alt="alt text"></p> <p><strong>8.</strong> Copy Data from the last step into two streams with the values <code>employee_id,office_id</code> and <code>employee_id,title_id</code> respectively. </p> <p><img src="https://i.stack.imgur.com/EvF7E.png" alt="alt text"> <img src="https://i.stack.imgur.com/I2LU8.png" alt="alt text"></p> <p><strong>9.</strong> Use a table insert to insert the join data. I've got it selected to ignore insert errors as there could be duplicates and the PK constraints will make some rows fail.</p> <h2>Output Tables</h2> <p><img src="https://i.stack.imgur.com/I5dXv.png" alt="alt text"></p> <p><img src="https://i.stack.imgur.com/jrQwJ.png" alt="alt text"></p> <p><img src="https://i.stack.imgur.com/k0Go0.png" alt="alt text"></p> <p><img src="https://i.stack.imgur.com/TBP7J.png" alt="alt text"></p> <p><img src="https://i.stack.imgur.com/Jur5w.png" alt="alt text"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload