Sending same row to different outputs with updated column

  • Hello all,

    I'm not sure why this isn't working but here goes:

    I have a script component I want to send the same row to two different outputs except I want to change one of the columns for one of the rows. For some reason it changes that row for both and I'm not sure why. Here's my sampl

    If CleanRecord then

    Row.DirectRowToCleanOutput() 'This works fine

    Else

    Row.DirectRowToErrorOutput()

    Row.PAIDDATE = #11/6/1984#

    Row.DirectRowToScrubOutput()

    End if

    After else statement I want record to go to Row.DirectRowToScrubOutput() and Row.DirectRowToErrorOutput() but I want Row.PAIDDATE to be changed to #11/6/1984# before going to Row.DirectRowToScrubOutput()

    The record foes to both outputs just fine, but for some reason, paid date is changed to #11/6/1984# for both outputs and I only want it changed before going to Row.DirectRowToScrubOutput().

    Am I doing something wrong here?

    Thanks,

    Strick

  • If CleanRecord then

    Row.DirectRowToCleanOutput() 'This works fine

    Else

    Row.DirectRowToErrorOutput()

    Row.PAIDDATE = #11/6/1984#

    Row.DirectRowToScrubOutput()

    End if

    So PAIDDATE gets updated Even if Row.DirectRowToCleanOutput() is updated? I assum the paiddate is some other value before this trasform is executed?

    Dan

    If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.

  • I've spent some time in the script task and I think this is tied to the fact that your are effectively working with a buffer and you are modifying the buffer, I am guessing that the row isn't truly written until it finishes the row.

    I have a workaround though, on the Scrub path you could add a derived column task that forced the value to what you want. It isn't ideal, but short of taking a copy of the row into a seperate buffer I think that is the best way.

    CEWII

  • Dan.Humphries (6/9/2010)


    If CleanRecord then

    Row.DirectRowToCleanOutput() 'This works fine

    Else

    Row.DirectRowToErrorOutput()

    Row.PAIDDATE = #11/6/1984#

    Row.DirectRowToScrubOutput()

    End if

    So PAIDDATE gets updated Even if Row.DirectRowToCleanOutput() is updated? I assum the paiddate is some other value before this trasform is executed?

    No, the first case is a good record so it doesn't get updated at all. That gets uploaded to SQL table. The second case is an error record which will go to a file which will be reviewed by a user and corrected. The third case is the same error record which needs to be cleaned by setting it to null so it can successfully be inserted into SQL table.

    Thanks,

    Strick

  • Sorry update was a poor choice of word. what I meant to ask more is to clarify that when the record is clean and outputed to SQL any way the date is still changed even thouh no other part of the else statement is executed? that is the part that seems odd to me.

    Dan

    If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.

  • Dan.Humphries (6/9/2010)


    Sorry update was a poor choice of word. what I meant to ask more is to clarify that when the record is clean and outputed to SQL any way the date is still changed even thouh no other part of the else statement is executed? that is the part that seems odd to me.

    Hi, no, the only time it gets changed is when it's not clean. There technically is 2 "Non clean" outputs. One which goes to file and other that gets changed. Problem is when I update column, it does it for both outputs.

    Thanks,

    Strick

  • sorry I am dense today! I see what you are saying now. you would like it to output the row then update the date and output again.

    Dan

    If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply