Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper Imports Microsoft.SqlServer.Dts.Runtime.Wrapper Imports System.Data.Odbc
Public Class ScriptMain Inherits UserComponent
Dim odbcConn As OdbcConnection Dim odbcCmd As OdbcCommand Dim odbcParam As OdbcParameter
Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
Dim connectionString As String connectionString = Me.Connections.연결.ConnectionString odbcConn = New OdbcConnection(connectionString) odbcConn.Open()
End Sub
Public Overrides Sub PreExecute()
odbcCmd = New OdbcCommand("INSERT INTO pubs..ODBCTest(AddressID, City) VALUES(?, ?)", odbcConn) odbcParam = New OdbcParameter("@addressid", OdbcType.Int) odbcCmd.Parameters.Add(odbcParam) odbcParam = New OdbcParameter("@city", OdbcType.VarChar, 30) odbcCmd.Parameters.Add(odbcParam)
End Sub
Public Overrides Sub 입력_ProcessInputRow(ByVal Row As 입력Buffer)
With odbcCmd .Parameters("@addressid").Value = Row.AddressID .Parameters("@city").Value = Row.City .ExecuteNonQuery() End With
End Sub
Public Overrides Sub ReleaseConnections()
odbcConn.Close()
End Sub
End Class |
'연구개발 > DTS & SSIS' 카테고리의 다른 글
조회 변환을 이용한 데이터 처리 (0) | 2011.08.27 |
---|---|
조회 변환을 이용한 데이터 동기화 작업 (0) | 2011.08.27 |
ODBC 데이터 원본 구현하기 (0) | 2011.08.27 |
유니코드 형을 일반 문자형으로 변환하기 (0) | 2011.08.27 |
FOR 루프 컨테이너를 이용한 대기 작업 구현 (0) | 2011.08.27 |