Page 2 of 2

Posted: Wed Dec 26, 2007 1:00 pm
by suresh_dsx
I tried with a sample test the following

First i took a column name: Col1
Data type: Decimal
Data length: 15

First Stage variable name SONE: DecimalToString(DSLink4.Col1)
Second stage variavle name STWO: Length(SONE)
Third stage variable name STHREE: STR('0',9 - STWO)

The valus is passed to the target column name is FCol1
Data type: Varchar
Data lenth:30

i am getting the following output

source input:

123

target
000000000000123

It is not giving the actual result... what ever the input value ///it is reading and giving as an output...
the source column length is 15.. thats way it is giving 15 lenth...

i want only 9 lenth ....which is minus with the length of the column

i tried will all the options... this is immedeiate requirement to the client ... i am very new to parallel .... please help me on this


Thanks
Suresh

Posted: Wed Dec 26, 2007 1:02 pm
by suresh_dsx
I tried with a sample test the following

First i took a column name: Col1
Data type: Decimal
Data length: 15

First Stage variable name SONE: DecimalToString(DSLink4.Col1)
Second stage variavle name STWO: Length(SONE)
Third stage variable name STHREE: STR('0',9 - STWO)

The valus is passed to the target column name is FCol1
Data type: Varchar
Data lenth:30

i am getting the following output

source input:

123

target
000000000000123

It is not giving the actual result... what ever the input value ///it is reading and giving as an output...
the source column length is 15.. thats way it is giving 15 lenth...

i want only 9 lenth ....which is minus with the length of the column

i tried will all the options... this is immedeiate requirement to the client ... i am very new to parallel .... please help me on this


Thanks
Suresh

Posted: Wed Dec 26, 2007 1:14 pm
by ArndW
Suresh - I am going to give up soon; I don't understand what you are doing or saying and it seems that you haven't done what I asked, but are posting other output.

Please do one thing - if your input column DSLink4.test1 is of a number type then please do NOTHING except this derivation to a VarChar(10) column:

Code: Select all

STR('0',9 - Len(DecimalToString(DSLink4.test1))):DecimalToString(DSLink4.test1)
please note - no stage variables, no other derivations. Just this code and writing to a VarChar(10) column.