Page 1 of 1
Stage Variable intial value
Posted: Mon Dec 13, 2010 6:33 am
by karthi_gana
All,
I would like to know what is the initial value of a stage variable.
In DB side, NULL will be stored as the default value.
Null is Null
Posted: Mon Dec 13, 2010 7:45 am
by sauros73
Hi I made a little test:
- * Create a job = > Row Generator (RG) > Transformer (T) > Peek (P)
* One field of RG called Attribut as VarChar(255)
* In T a stage variable called StageVar as VarChar(255) without any derivation
* In T a output field have this derivation "DSLink2.Attribut : "@" : StageVar"
In the P the result output like that Peek_3,2: "Attribut:cccc@"
That mean that the default value of a stage variable without any derivation is Null.
![Wink :wink:](./images/smilies/icon_wink.gif)
Posted: Mon Dec 13, 2010 2:39 pm
by ray.wurlod
In a server job I'd imagine that the variable would be in an unassigned state. But you can check the generated Transformer stage code to verify this.
Posted: Mon Dec 13, 2010 4:17 pm
by eostic
In a previous life I recall having a saying that "Default" and "Disaster" both begin with the letter "D"......meaning --- if you care about it, assign it a value manually......
A curious discussion, but in the end, give it something so that it never becomes an issue one way or the other.
Ernie