Hello. I am new to DataStage, so hopefully I ask the question correctly.
I would like to create a job that when selecting a row from the source (DB2 UDB), will perform a row-level lock. After copying the data to the destination, deletes the source row.
Thanks,
Al
Deleting from source
Moderators: chulett, rschirm, roy
Deleting from source
Al Howarth
System Specialist/Slacker
Berkley Technology Services
System Specialist/Slacker
Berkley Technology Services
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
Hi,
The source and destination are db2 that fine but are they same table.
If not:
1. You can do it in one job by using one Db2 stage, but need to check with the execution order. Else better to design a second job.
If yes:
You can use user defined query option one to load in generated tab and in after tab use the delete statement.
The source and destination are db2 that fine but are they same table.
If not:
1. You can do it in one job by using one Db2 stage, but need to check with the execution order. Else better to design a second job.
If yes:
You can use user defined query option one to load in generated tab and in after tab use the delete statement.
-
- Premium Member
- Posts: 503
- Joined: Wed Jun 29, 2005 8:14 am
-
- Participant
- Posts: 232
- Joined: Fri Sep 30, 2005 4:52 am
- Contact:
Hi,
If there are few numbers of rows you are selecting then you can delete rows from source while inserting into target... becsuse will lock be for select and in one shot you will get all required row and lock will be released after...so you can delete data from source while inserting into target
but If there there is more number of rows then better populate key column from source into flat file while inserting into target and link that file to source and write user defined query to delete.
Source------->Transformer--------->Target
|
|
----------------->Flatfile ------->Source
__________
Anupam[/img]
If there are few numbers of rows you are selecting then you can delete rows from source while inserting into target... becsuse will lock be for select and in one shot you will get all required row and lock will be released after...so you can delete data from source while inserting into target
but If there there is more number of rows then better populate key column from source into flat file while inserting into target and link that file to source and write user defined query to delete.
Source------->Transformer--------->Target
|
|
----------------->Flatfile ------->Source
__________
Anupam[/img]
Last edited by sb_akarmarkar on Thu Oct 19, 2006 3:50 am, edited 1 time in total.