Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: How to insert rows into a table only if its primary keys exist in another table

  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Default How to insert rows into a table only if its primary keys exist in another table

    Hi all,

    I'm new to Kettle and I need help on the Update step. I have a transformation which updates a table (TableA) and inserts selected fields into another table (Table B). My problem is, I only need to insert rows into TableB whose primary key exists in TableA. Is there a way to do that? If possible, all this should be in a single transformation.

    I tried using Javascript for the conditions but I can't seem to make it all work. Please help!


    Thanks,
    Dei

  2. #2
    Join Date
    Jun 2007
    Posts
    260

    Default

    Go ahead and do the lookup on table A (before UPDATE-ing, probably). The lookup step has an option "Do not pass the row idfthe lookup fails".

    Will that not work for you?

  3. #3
    Join Date
    Jul 2008
    Posts
    2

    Default

    yes, that did the trick..
    thanks very much for the help.

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.