Redirecting failed record using script component

  • Hi,

    Here is the situation.

    We extract data from mainframe using a flat file. The flat file is parsed , checked for data validation and loaded into tables.

    I used flat file source==>Derived column==>table. In derived column, I am converting string to decimal, date etc based on how the table field is defined. If the conversion fails, the input row is directed to an error file. The problem is along with the input record, error code and error column are written out to the file which is not very helpful. Is there any way, you can add custom error description example the column name that failed along with the value.

    I thought script may be a better solution since you can control what you want to do. The problem I run into is, there is no error output from a script component so even if I trap a conversion that failed and write to an error file, the bad record is still part of the output stream. How do I redirect a row if it fails with in the script. What is the syntax to write the full input record. I am using row. and all the individual columns. I am sure there is a better way.

    Thanks in advance for your time.

    Peter

  • You could create script task with multiple outputs, 1 for "good" rows and 1 for "error" rows, and pass the outputs to the appropriate destinations. Check out this article[/url].

  • Thanks for your response.

    I am not some one who looks to this forum for every bit of doubt I have. Unfortunately, the book I have for reference didn't talk much about the issue in detail and Google search returned vague stuff.

    The article you had provided helped me to some extent, but when I did a refined search, I got the microsoft site which talked about the exact issue I wanted answers for.

    Here is the link

    http://msdn.microsoft.com/en-us/library/ms136114(SQL.90).aspx

    I just have one question.

    In the sample code "Public Overrides Sub MyAddressInput_ProcessInputRow(ByVal Row As MyAddressInputBuffer)" talks about overriding ProcessInput method. My script keeps complaining that I have to delete the override. If I run the script with out the override, do you know what is the consequences.

    Thanks for your time.

    Peter

Viewing 3 posts - 1 through 2 (of 2 total)

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