Using GetDouble() On The PipelineBuffer
Jan 23, 2007
Hi,
I'm using the GetDouble() method of the PipelineBuffer to get a double from a flat file, to transform it and to rewrite it to the readwrite input column.
The input column I read the double from has a DT_R8 data type.
If my input file contains 18.45, then the GetDouble() method returns 18.44999999999, and when I rewrite the double without transformation, the target file contains 18.449999999999 !!
The only way to get 18.45 in the target file is to create a RT_DECIMAL output column and to write the result using SetDecimal(index, new decimal(doubleValue)) to that new column (when calling SetDecimal(), doubleValue contains 18.449999999999 but the written decimal is 18.45)
If I really want to rewrite the double to my input column, I have to set my input column as a DT_DECIMAL and in that case I have to specify the DataScale property of the input column in my connection manager. This DataScale is set to zero by default, and then the readen decimal is 18 and not 18.45. Then, I would like to avoid having to modify this property that could generate errors...and finally I would like to avoid using DT_DECIMAL input columns...
I really don't understand why GetDouble() returns 18.44999999999 since the input data is 18.45
Does anybody knows a way to simply get the real double value ?
Thanks for your help,
David
View 1 Replies
Sep 2, 2007
I need to add a value to a column that I know to be DT_CY. However, there is no PipelineBuffer.SetCurrency() method or anything similar.
I checked out the docs for PipelineBuffer.SetDecimal() and it states "If the DataType of the buffer column is not DT_NUMERIC, an UnsupportedBufferDataTypeException occurs"
Similarly for PipelineBuffer.SetDouble() it says "If the DataType of the buffer column is not DT_R8, an UnsupportedBufferDataTypeException occurs"
So it seems I can't use either of those two methods. How do I push a valueto an output column of DT_CY when building an async component?
By the way, I could ask the same about
DT_DBDATE
DT_DBTIME
DT_FILETIME
DT_IMAGE
DT_TEXT
DT_NTEXT
DT_R4
DT_UI1
as well because according to the documentation there doesn't seem to be a method that supports those either. So, please could you answer the same question for those as well!
Thanks
Jamie
[Microsoft follow-up]
View 13 Replies
View Related
Jan 22, 2007
Hi,
I'm using the SetDouble(double) method on the PipelineBuffer to write some data to the default output of my SSIS custom transformation component.
The Data Type of the output column I am writting to is DT_R8.
Just after my component, I have a simple Flat File Destination, and here is the content of the target file:
SetDouble parameter | Flat File content
18,45 | 18,449999999999999
19,45 | 19,449999999999999
23,78 | 23,780000000000001
Does any one know where this behaviour is coming from ?
Am I doing something wrong ?
Do I have to modify the Data Type Properties of the output column or someting like that ? (but I think there is no data type property to set with a DT_R8)
Thanks for your help,
David
View 1 Replies
View Related
Oct 27, 2006
Hi,
I need to access columns from a data flow by ordinal position in a script transformation (I'm parsing an excel file which has several rowsets across the page). The first problem I encountered is the generated BufferWrapper does not expose the columns collection (i.e. Input0Buffer(0) does not work) but I got around that by implementing my own ProcessInputs(InputId, Buffer) method instead of using the wrapper.
My problem now is that the column ordinals are in some random order (i.e. Column "F1" is ordinal 1 but Column "F2" is 243). Where in the object model can I map between the name and the ordinal - it's not jumping out at me?
Dave
PS Why is the script editor modal, it's frustrating having to switch between the Visual Studio environment and the VSA one.
View 3 Replies
View Related