Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Using value from previous version for where clause

  1. #1
    Join Date
    Jul 2006
    Posts
    20

    Default Using value from previous version for where clause

    Dear all,

    I have a query that is run in a "Table input", this query will return a one row and one field data. Now I want to use this value as a where clause in the next step which is a table input also. Is this possible to be done in Kettle? This is what I have done:

    Table input 1:
    SQL:
    Select LastUpdate From History

    Table input 2:
    Select ActionDate From Action
    Where ActionDate = Lastupdate

    But it doesn't work. Have I done something wrong?

    Please give me hints on this.

    Best regards,
    Best Regards,

    Check out my blog

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    in the second table input use a ? instead of Lastupdate (without quotes around the ?). Then in the second table input set "Insert data from step" to the right hop and activate "Execute for each row".

    That should be about it.

    Regards,
    Sven

  3. #3
    Join Date
    Jul 2006
    Posts
    20

    Default

    Quote Originally Posted by sboden View Post
    in the second table input use a ? instead of Lastupdate (without quotes around the ?). Then in the second table input set "Insert data from step" to the right hop and activate "Execute for each row".

    That should be about it.

    Thanks Sven,

    It looks like there's a problem if the table input in form of date.
    Best Regards,

    Check out my blog

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    Not really... what's your error.

    Regards,
    Sven

  5. #5
    Join Date
    Jul 2006
    Posts
    20

    Default

    Quote Originally Posted by sboden View Post
    Not really... what's your error.
    I get a NullPointer Exception, looks like it can not match with the data from the previous step.

    Best regards,
    Best Regards,

    Check out my blog

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    lol ... not that helpful information ... post the transformation (cleaned of all paswords, IP adresses, ...)

    Regards,
    Sven

  7. #7
    Join Date
    Jul 2006
    Posts
    20

    Default

    Sven,

    I've unchecked the "Do for all rows" and it works. Strange. But anyway, it works as I expected now.

    Many thanks
    Best Regards,

    Check out my blog

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.