Please look in to the code and tell me what can i do to skip the row.
Appreciate your prompt response.
----------------------------------------------------------------------------------------------------------
Imports System
Imports System.Data
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports System.Text.RegularExpressions
Public Class ScriptMain
Inherits UserComponent
Dim doMap As Boolean
Dim doLedger As Boolean
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim parts() As String
doMap = False
parts = Split(Row.Col4, " ")
Select Case Trim(Row.Col2)
Case "by"
doMap = True
If InStr(Row.Col4, "SPINOFF") > 0 Or InStr(Row.Col4,
"STKSPLIT") > 0 Then
doMap = False
End If
If InStr(Row.Col4, "SECURITY NAME CHANGE") > 0 Then
doMap = False
End If
If parts(0) = "ca" Then
doMap = False
doLedger = True
End If
Case Else
doMap = False
End Select
If doMap = False Then
MapGLColumns(doLedger)
Row.NextRow() 'Here i want to skip the row
Else
MapTaxColumns(Row)
MapGLColumns(doLedger)
End If
End Sub
Function MapTaxColumns(ByVal Row As Input0Buffer) As Boolean
If doMap = True Then
Dim dtStr As String
Dim mparts As String()
Dim myCol4 As String = Row.Col4
Dim mycol5 As String
mycol5 = Regex.Replace(myCol4, "[ ]+", " ")
myCol4 = mycol5
dtStr = Trim(Row.Col3)
mparts = Split(myCol4.Trim, " ", -1, CompareMethod.Text)
dtStr = Left(dtStr, 2) & "/" & Mid(dtStr, 3, 2) & "/" & "20" &
Right(dtStr, 2)
If Integer.Parse(Row.ActId) <> 0 Then
Row.myACCTID = Integer.Parse(Row.ActId)
Row.mycusip = mparts(1)
Row.myPURCHDATE = CDate(dtStr)
Row.myINITIALCOST = CDec(Decimal.Parse(Trim(mparts(2))))
Row.myPARENTTAXLOTGID = 0
Row.myTAXLOTSTATUSCODE = "OPEN"
End If
End If
End Function
Function MapGLColumns(ByVal bdoLedger As Boolean) As Integer
If bdoLedger = CBool(True) Then
MapGLColumns = 1
Else
MapGLColumns = 0
End If
End Function
End Class
"Jamie Thomson" wrote:
Quote:
I assume you mean in a script component seeing as this is the only component
containing .Net code that can affect the pipeline?
Seeing as you have full control of what gets written to the pipeline by a
script component it shouldn't be too hard to do this. You add a row to the
pipeline using <output_name>.AddRow() so if you want to skip a row, don't
call .AddRow() on it.
Does this make sense? Does it answer your question?
Regards
Jamie Thomson
Jamie.Thomson (AT) Conchango (DOT) com
An SSIS blog - http://blogs.conchango.com/jamiethom...tegory/71.aspx
"DDR" <DDR (AT) discussions (DOT) microsoft.com> wrote in message
news:64632568-611E-49C0-BB60-BF6A837A162D (AT) microsoft (DOT) com...
In DTS 2000 Vb script there is "DTSTransformStat_SkipRow" which will
skip a row when we are processing.
I need the equivalent of this in 2005 how to write in VB.NET Code
If you can find some thing please let me know. |