Page 1 of 1

How to find how many digits to concatenate

Posted: Mon Sep 16, 2013 1:43 am
by synsog
Hi All,

I have source fields column name, data_type, Field_size respectively. Suppose if actual value of column=155
Data_type of column=NUMBER
Field_Size of column=40

then I need to load the column value into target as
2000000000000000000000000000000000000155.


So please let me know how to get this.

Thanks

Posted: Mon Sep 16, 2013 2:11 am
by ArndW
While I am not sure that 40 digits are allowed (38 are), you have two basic approaches to creating your decimal number - either as a string and then convert it, or as a number. I'm also unsure of whether the transform stage compiler will take a 40-digit numeric constants as follows:

Code: Select all

In.Column+2000000000000000000000000000000000000000
but you won't know until you've tried it.

Posted: Mon Sep 16, 2013 2:50 am
by synsog
Hi ArndW, Thanks for reply. But the length is not fixed for all the columns and also it vary colum by column. What I am trying to say here is if the length is 12 and we got a value of 1234 then target shouldbe 200000001234.

For other columns field_size may differ.

Thanks

Posted: Mon Sep 16, 2013 3:53 am
by ArndW
In that case:

Code: Select all

In.Number+LEFT("200000000000000000000000000000000000000000",In.Length)