Hello,
I am trying to map some columns in source table to columns in target table. The problem is that for some target table columns there are no source columns specified. I am asked to fill that columns with defaults like 'Null' or to just leave them blank. My question is how can we leave the columns blank while mapping them in 'Transformer' stage, as the stage does'nt allow any columns without derivation.
Can anyone suggest me the correct way to leave some columns blank in the tables of target database.
Default values in target database
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can organize for default values to be set in the target database itself. Every column definition is able to have a DEFAULT clause.
Other than that, if the column is updated by DataStage, then DataStage must generate a value with which to update that column. It doesn't matter what you do or how you do it, DataStage must generate a value.
Presumably you want to allocate a default value (a constant) if some particular condition is true - usually that the incoming value from source is NULL. As others have suggested,is a suitable technique.
Other than that, if the column is updated by DataStage, then DataStage must generate a value with which to update that column. It doesn't matter what you do or how you do it, DataStage must generate a value.
Presumably you want to allocate a default value (a constant) if some particular condition is true - usually that the incoming value from source is NULL. As others have suggested,
Code: Select all
If IsNull(Source.Value) Then defaultvalue Else Source.Value
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Default values in target database
Thank you all for your help. Have a nice day.
yaminids wrote:Hello,
I am trying to map some columns in source table to columns in target table. The problem is that for some target table columns there are no source columns specified. I am asked to fill that columns with defaults like 'Null' or to just leave them blank. My question is how can we leave the columns blank while mapping them in 'Transformer' stage, as the stage does'nt allow any columns without derivation.
Can anyone suggest me the correct way to leave some columns blank in the tables of target database.