How to update the source table in the same job?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

dsdoubt
Participant
Posts: 106
Joined: Sat Jul 15, 2006 12:17 am

How to update the source table in the same job?

Post by dsdoubt »

Hi,
Pls let me know, how to update the source table in the same job based on some condition.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why bother with a DataStage job? All you need is an UPDATE statement in the database.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, sounds like a job for SQL. If you disagree, please expand on your question. Alot. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you do this then you might lock the records you are trying to update. So the source SQL needs to have the correct options on it.
Mamu Kim
dsdoubt
Participant
Posts: 106
Joined: Sat Jul 15, 2006 12:17 am

Post by dsdoubt »

kduke wrote:If you do this then you might lock the records you are trying to update. So the source SQL needs to have the correct options on it.
This is my concern. We are in desing phase, and dont have access to Datastage. So kindly let me know, if I read some data from a table, and trying to updated the same records with some change, will there be any lock. Can we acheive with read commit and Commit interval of 1 record?
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I think you want read uncommitted but I need to look it up. Sometimes you can do it in user defined SQL with a NOLOCK or whatever the database needs based on syntax.
Mamu Kim
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Unload your table into a flat file or dataset and then do your transformations and loading.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

DSguru2B wrote:Unload your table into a flat file or dataset and then do your transformations and loading.
But it again require two jobs, or some superfluous flow isolating stages.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

My direction was towards modularization. More like an advice on not to do it in a single job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSGuru79
Charter Member
Charter Member
Posts: 12
Joined: Thu Nov 09, 2006 8:57 pm

Post by DSGuru79 »

Yes I agree with DSGuru2B. In my project we have this kind of scenario. We always use 2 jobs and it works fine.
1. Dump the tables into dataset for reading (job 1)
2. Update the same table by lookup on the dataset (job 2)
DSGuru79
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:? So, if we can have 79, is 2B a hex number. And, if so, is 79 a hex number?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Very funny Ray, 2B a bionic number. :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

And here's me assuming it was a blackness grade in pencils...
8)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I think doing this in one job is fine.
Mamu Kim
dsdoubt
Participant
Posts: 106
Joined: Sat Jul 15, 2006 12:17 am

Post by dsdoubt »

Thanks Kim.

May I know how to specify the Uncommited read?
Post Reply