Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Use Input Table result as an argument to another Input Table step

  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Question Use Input Table result as an argument to another Input Table step

    Hi!

    I need use the result of Input Table step, to filtering in clause 'where value in (?)' of other Input Table step.
    I've tried use 'copy rows to result' but it's not work.

    Any idea?

    Thanks in advance.

  2. #2
    Join Date
    Nov 2008
    Posts
    271

    Default

    Copy rows to result is intended to pipe the stream towards a following transformation.

    Use a database join step instead of a second input table. It accepts parameters contained in a stream field.

    Regards
    Last edited by Ato; 08-09-2012 at 05:25 AM.
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  3. #3
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by apemat View Post
    I need use the result of Input Table step, to filtering in clause 'where value in (?)' of other Input Table step.
    I would use the first query as a subquery, thus eliminating a second Table Input step altogether:

    Code:
    SELECT ... FROM someTable WHERE someField IN (
        SELECT someOtherField FROM someOtherTable WHERE ...
    )
    So long, and thanks for all the fish.

  4. #4
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    In the event that your second table is in a different DB, you can chain two Table Inputs together, and select the Input Data from Step option.

    Instead of 'where value in (?)' you would write 'where value = ?' and PDI will replace the ? with the value coming from the 1st Table Input.

    NOTE: If the two tables exist in the same DB, Marabu's solution is more efficient.

  5. #5
    Join Date
    Aug 2012
    Posts
    2

    Default

    Thanks you very much!

    I used the Marabu's solution and it worked fine!!

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.