Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Step update

  1. #1
    Join Date
    Feb 2011
    Posts
    240

    Default Step update

    Hi,

    I must run this query:

    update sins_soc set soc_ass_accomp = 'N'
    where soc_ass_accomp is null
    and anno=anno_elab;

    and I've this transformation:

    table input (sins_soc) -> filter rows (where soc_ass_accomp is null
    and anno=anno_elab) -> select values -> insert/update,

    But but how do I set soc_ass_accomp = 'N'?

    Thanks

    Mariarita

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Default

    In your table input there should be a column called soc_ass_accomp.
    after your Filter add a calculator step and set soc_ass_accomp = 'N'.

    Mick

  3. #3
    Join Date
    Sep 2011
    Posts
    190

    Default

    Why don't you just run the query, I don't really see the need to translate a query this simple and atomic to multiple ETL steps?

  4. #4
    Join Date
    Feb 2011
    Posts
    240

    Default

    and how? into an input table?

  5. #5
    Join Date
    Sep 2011
    Posts
    190

    Default

    No, I was thinking of an 'Execute SQL script' step

  6. #6
    Join Date
    Feb 2011
    Posts
    240

    Default

    Then an input step (for sins_soc table) and a execute sql script whith this code: update sins_soc set soc_ass_accomp = 'N'
    where soc_ass_accomp is null
    and anno=anno_elab;

    ???

  7. #7
    Join Date
    Sep 2011
    Posts
    190

    Default

    You don't even need the input step. Your update statement doesn't take input, it updates itself from itself.

    So an 'Execute SQL script' step with just this SQL suffices:
    UPDATE sins_soc
    SET soc_ass_accomp = 'N'
    WHERE soc_ass_accomp IS NULL
    AND anno=anno_elab;

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.