I have a source feild whose datatype is varchar. I have to convert this to SmallInt in Target. What kind of a function I can use in Transformer.
Please suggest.
Thanks
Varchar to SmallInt
Moderators: chulett, rschirm, roy
You can use StringToDecimal(<input port.)
If you want to check before converting you can use the following:
If IsNull(<input port>) Then SetNull()
Else If Trim(<input port>) Then Setnull()
Else Trim(<Input port>)
If you want to check the validity of the data before converting you can also use the IsValid function
If IsValid ("unit32",<input port>) Then StringtoDecimal(<input port>)
If you want to check before converting you can use the following:
If IsNull(<input port>) Then SetNull()
Else If Trim(<input port>) Then Setnull()
Else Trim(<Input port>)
If you want to check the validity of the data before converting you can also use the IsValid function
If IsValid ("unit32",<input port>) Then StringtoDecimal(<input port>)