Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Updating different columns based on update or Insert

  1. #1
    Join Date
    Jan 2017
    Posts
    2

    Question Updating different columns based on update or Insert

    Is there a way to selectively set date fields based on whether it is an update vs insert? If the record already exists I'd like to update the modified date rather than the create date.....and if it is an insert, then set the create date and not the modified date.... If needed I can use a filter step, but was hoping this could be done in 1 step. Thanks for the input on this.
    Last edited by gutlez; 01-24-2017 at 04:39 PM.

  2. #2
    Join Date
    May 2016
    Posts
    277

    Default

    I think the Insert/Update step won't let you, you'll have to perform the Insert in one step and the Update in another. What you can do is set the columns you want to update, you don't need to update all the columns you set for insert, in your case I would setup the create date and modified date with the same column, but when you update you don't update the create date.

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

    Default

    I can't recall a project where I didn't use DDL / triggers for "timestamping".
    It keeps the management of this technical information away from the application / business logic.
    So long, and thanks for all the fish.

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.