Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Delay 2nd insertion until 1st completes

  1. #1

    Default Delay 2nd insertion until 1st completes

    Hi

    I have to make a transformation where i need to insert data into two tables but the case is that i want to insert the data into 2nd table when insertion in first table completes.

    it means insertion in 2nd table is dependent on 1st table insertion. Which control will be used to handle this situation?

    Regards
    Shuja

  2. #2
    Join Date
    Oct 2007
    Posts
    107

    Default

    One way might be to have two streams (your 2 insert sets) that you merge together with a field such as "SortOrder" which is equals to 1 in the first stream and 2 for the second strem and before having the "Table Output" step, just make sure you sort on this "SortOrder".
    Is that what you're looking for?

  3. #3

    Default

    the structure of both tables is different means number of columns. actaully i am new to etl and do not have much idea abt sortorder. can u explain a bit more?
    Thanks

  4. #4
    Join Date
    Oct 2007
    Posts
    107

    Default

    Sorry about that, I missread initially as I thought you were inserting at the end in only one table.

    Let me try again with another option then
    What you can do is to create two transformation and call them one after the other from within a job.

  5. #5

    Default

    Thanks for quick solution. so it means that it can not be achieved in one transformation?

  6. #6
    Join Date
    Oct 2007
    Posts
    107

    Default

    Yes it can, you would have to play with the "Blocking Step" but since you're beginning with ETL, I just wanted to give you the easier way

    With the Blocking step what you can do is have your first insert (Table Input --> Table Output) then have a Blocking Step and then your second insert (Table Input --> Table Output)

    Quote Originally Posted by shujamughal View Post
    Thanks for quick solution. so it means that it can not be achieved in one transformation?

  7. #7

    Default

    Thanks a lot chamel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.