Alter Table in Parallel 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

Post Reply
nohDS
Participant
Posts: 6
Joined: Tue Aug 23, 2016 11:38 am

Alter Table in Parallel Job

Post by nohDS »

Is there a way to add/drop columns in a parallel datastage job during runtime?

For example: If I have a db2 table called Table1 with ColA and ColB, I want to be able to run a datastage job that can add ColC or remove ColA or ColB.

Is this possible?
leandrohmvieira
Participant
Posts: 44
Joined: Wed Sep 02, 2015 7:19 am
Location: Brasilia, Brazil

Post by leandrohmvieira »

I think there is a way if there is some logic behind when drop and create columns, but IMO, this will be a little hard to maintain. Is there some special motive to drop and create columns on runtime?

Why not mantain ColA, ColB and ColC always on table and just fill it with nulls or dummy data?
Leandro Vieira

Data Expert - Brasilia, Brazil
nohDS
Participant
Posts: 6
Joined: Tue Aug 23, 2016 11:38 am

Post by nohDS »

The columns ColA, ColB and ColC are only created depending on how many records there are in another dimension table. So if a customer were to stage more records into the dimension table, I would want a datastage job that can handle the addition of more columns.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can use a Column Generator stage to add and drop columns.
You can use pretty much any stage to drop columns; Copy stage is probably the most efficient.
A dynamic approach might be possible using the Modify stage, or alternate streams of processing in the job design.
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 »

And, of course, your DataStage user would need to have the grants needed to alter tables... something that would never fly places where I have worked. Perhaps via an SP call, however.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply