Hello,
i am new on data stage and i wonder if i can set a "initial create date" and a "last update date" in a table for each row. The table has one key. The Process is an update/insert. i want to save two date's "initial create date" and the "last update date".
in transformer stage i found only the function currentimestamp() but this way set everytime the date when i run the job...
How can i do this?
Thanks a lot
Set row "create_date" and "last_update_date&q
Moderators: chulett, rschirm, roy
You have to identify which rows to update and which ones to insert and split the streams for these two operations.
Then you can set initial create date on insert and last update date on update.
But Datastage won't identify which column to write in an Insert/Update-Operation.
Then you can set initial create date on insert and last update date on update.
But Datastage won't identify which column to write in an Insert/Update-Operation.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
There are the grateful those are happy." Francis Bacon
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The issue with the "upsert" mechanism is that all columns that you need for the insert must also be used in the update. Typically there are columns that you do not want to change, such as the create date, and in order to do that you need to look up the current value and pass that along rather than the current date when the record already exists. And then the insert will need to fail before the update is performed if that is the order of execution.
I personally find the 'combo' insert/update actions to be a crutch and not something one should use the vast majority of the time. Do the lookup, get the information you need for the update and then send them to separate targets doing either the insert or the update. And in this particular case, the only information you may need from the lookup is whether it succeeded or not.
I personally find the 'combo' insert/update actions to be a crutch and not something one should use the vast majority of the time. Do the lookup, get the information you need for the update and then send them to separate targets doing either the insert or the update. And in this particular case, the only information you may need from the lookup is whether it succeeded or not.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I agree with Craig. Split and insert or update separately.
This is especially true if the number of updates is small. Upsert and update operations are incredibly time consuming in most databases, Inserts are normally very quicl. Insert/Update (or update/insert) tend to take a lot of time.
Be careful of your transaction size. These are no absolutes as it depends on number and size of records and indexes impacted. Play with it a bit.
This is especially true if the number of updates is small. Upsert and update operations are incredibly time consuming in most databases, Inserts are normally very quicl. Insert/Update (or update/insert) tend to take a lot of time.
Be careful of your transaction size. These are no absolutes as it depends on number and size of records and indexes impacted. Play with it a bit.
Andrew
Think outside the Datastage you work in.
There is no True Way, but there are true ways.
Think outside the Datastage you work in.
There is no True Way, but there are true ways.