Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental update on two dates

I am looking for a little guidance on the an incremental update problem. I am using Rob's template from his cookbook. My issue is that I have to join multiple tables and check if any of the tables have been updated. I have a record on every table named last_updated. If anything in the record changes this date changes.

I have an order and an order track table. I need to update the record if either of the last updated date changes on either of these tables. This seems pretty straight foward maybe this have been solved before.

Would one option be to concat both dates and the order code to use as a key? Any suggestion will help

I would gladly post my script and application but I am unsure how to attach a file?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming you want only one row per order, the key should be the single field ORDER_CDE. You can also do away with the PK hashing and just refer to ORDER_CDE in the exists().

As for selecting a row if either table is updated, how about this for your incremental expression:

(o.LAST_UPDATED>='01/Jan/09' OR ot.LAST_UPDATED>='01/Jan/09)

-Rob

View solution in original post

3 Replies
Not applicable
Author

Here is the application with the load script

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming you want only one row per order, the key should be the single field ORDER_CDE. You can also do away with the PK hashing and just refer to ORDER_CDE in the exists().

As for selecting a row if either table is updated, how about this for your incremental expression:

(o.LAST_UPDATED>='01/Jan/09' OR ot.LAST_UPDATED>='01/Jan/09)

-Rob

Not applicable
Author

Thanks Rob this makes more sense, I will try to work something up with this and post back.