June 3, 2008 at 11:22 am
Hello everyone,
I'm have a script component transformation that I'm testing out. More or less to learn how it works. So my example is very basic.
Ok, in my dataflow, I have a oledbsource and a script component as a transformation. To see the data I just have a dataviewer between the oledb source and the script task. I have two outputs in the script component (Output1 and Output2). In the script task all I have is:
If Row.MEMBERID = "WX0000075" Then
Row.DirectRowToOutput1()
Else
Row.DirectRowToOutput2()
End If
This seems to be extremely straight forward but it's not working. The record with memberID = "WX0000075" should begoing to output1 and everything else to output2. But all the records are going to output2.
Please note that I know there is a record in the oledbsource where the member id = "WX0000075" because I checked and am using this record as a test so I don't understand why all the records are gonig to outpu2.
Can anyone tell what I'm doing wrong?
Strick
June 3, 2008 at 11:56 am
I would first suspect data type or collation. The comparison being done is going to be very type-sensitive and absolutely case and accent sensitive. Make sure you do not have a lowercase character in the field and make sure the data type of the field is not mismatching (unicode perhaps?).
June 3, 2008 at 12:44 pm
Hi,
Damn I hate when it's small stuff..lol. Thanks for your help Michael. It wasn't the data type, but your mention on case sensitivity made a little light go off. As it turns out, the source object is a fixed width file not an oledbsource. The fixed width of the MemberID is 15 spaces. So when I was looking at it in dataviewer (can't see the trailing spaces) it looked like "WX0000075" when in actuality it was "WX0000075 "
So I changed my criteria to:
If Row.MEMBERID.Trim = "WX0000075" Then
Row.DirectRowToOutput1()
Else
Row.DirectRowToOutput2()
End If
And it worked. Sometimes all it takes is for you to bounce something off someone and their response makes you think of the smallest things..lol
Thanks.
Strick
June 4, 2008 at 12:55 am
Yeah, ETL tools normally make you sweat on the small stuff.
Anyone ever dealing with DataStage will tell you how much sweat a "Phantom Error" is.
But the cool thing is that the seriously big stuff it handles really well.
~PD
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply