PipelineBuffer.DirectErrorRow 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
속성이 인 true에 IDTSOutput100IsErrorOut 행을 PipelineBuffer 보냅니다.
오버로드
| Name | Description |
|---|---|
| DirectErrorRow(Int32, Int32, Int32) |
속성이 참인 에 IDTSOutput100IsErrorOut 대해 행을 PipelineBuffer 보냅니다. |
| DirectErrorRow(Int32, Int32, Int32, Int32) |
속성이 참인 에 IDTSOutput100IsErrorOut 대해 행을 PipelineBuffer 보냅니다. |
DirectErrorRow(Int32, Int32, Int32)
속성이 참인 에 IDTSOutput100IsErrorOut 대해 행을 PipelineBuffer 보냅니다.
public:
void DirectErrorRow(int outputID, int errorCode, int errorColumn);
public void DirectErrorRow(int outputID, int errorCode, int errorColumn);
member this.DirectErrorRow : int * int * int -> unit
Public Sub DirectErrorRow (outputID As Integer, errorCode As Integer, errorColumn As Integer)
매개 변수
- outputID
- Int32
행을 PipelineBuffer 보내기 위한 오류 IDTSOutput100 ID입니다.
- errorCode
- Int32
행을 처리하는 동안 발생한 오류 번호입니다.
- errorColumn
- Int32
오류를 일으킨 열의 PipelineBuffer ID입니다.
예제
다음 코드 예시는 이 DirectErrorRow 메서드를 사용하여 버퍼 내 행을 동기식 오류 출력으로 유도하는 방법을 보여줍니다.
public override void ProcessInput(int inputID, PipelineBuffer buffer)
{
IDTSInput100 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);
/// This code sample assumes the component has 2 outputs, one the default,
/// the other the error output. If the errorOutputIndex returned from GetErrorOutputInfo
/// is 0, then the default output is the second output in the collection.
int defaultOutputID = -1;
int errorOutputID = -1;
int errorOutputIndex = -1;
GetErrorOutputInfo(ref errorOutputID,ref errorOutputIndex);
if (errorOutputIndex == 0)
defaultOutputID = ComponentMetaData.OutputCollection[1].ID;
else
defaultOutputID = ComponentMetaData.OutputCollection[0].ID;
while (buffer.NextRow())
{
try
{
/// TODO: Implement code to process the columns in the buffer row.
/// Ideally, your code should detect potential exceptions prior to them occurring, rather
/// than having a generic try/catch block such as this.
/// However, since the error or truncation implementation is specific to each component
/// this sample focuses on actually directing the row, and not a single error or truncation.
/// Unless an exception occurs, direct the row to the default
buffer.DirectRow(defaultOutputID);
}
catch
{
/// Yes. Has the user specified to redirect the row?
if (input.ErrorRowDisposition == DTSRowDisposition.RD_RedirectRow)
{
/// Yes, direct the row to the error output.
/// TODO: Add code to include the errorColumnID
buffer.DirectErrorRow(errorOutputID, 0, errorColumnID);
}
else if (input.ErrorRowDisposition == DTSRowDisposition.RD_FailComponent || input.ErrorRowDisposition == DTSRowDisposition.RD_NotUsed)
{
/// No, the user specified to fail the component, or the error row disposition was not set.
throw new Exception("An error occurred, and the DTSRowDisposition is either not set, or is set to fail component.");
}
else
{
/// No, the user specified to ignore the failure so
/// direct the row to the default output.
buffer.DirectRow(defaultOutputID);
}
}
}
}
Public Overrides Sub ProcessInput(ByVal inputID As Integer, ByVal buffer As PipelineBuffer)
Dim input As IDTSInput100 = ComponentMetaData.InputCollection.GetObjectByID(inputID)
Dim defaultOutputID As Integer = -1
Dim errorOutputID As Integer = -1
Dim errorOutputIndex As Integer = -1
GetErrorOutputInfo(errorOutputID, errorOutputIndex)
If errorOutputIndex = 0 Then
defaultOutputID = ComponentMetaData.OutputCollection(1).ID
Else
defaultOutputID = ComponentMetaData.OutputCollection(0).ID
End If
While buffer.NextRow
Try
buffer.DirectRow(defaultOutputID)
Catch
If input.ErrorRowDisposition = DTSRowDisposition.RD_RedirectRow Then
buffer.DirectErrorRow(errorOutputID, 0, errorColumnID)
Else
If input.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent OrElse input.ErrorRowDisposition = DTSRowDisposition.RD_NotUsed Then
Throw New Exception("An error occurred, and the DTSRowDisposition is either not set, or is set to fail component.")
Else
buffer.DirectRow(defaultOutputID)
End If
End If
End Try
End While
End Sub
설명
이 방법은 속성이 IsErrorOut 로 설정된 true객체를 가진 IDTSOutput100 데이터 흐름 구성 요소에서 사용됩니다. 컴포넌트가 버퍼 행을 처리하는 과정에서 오류가 발생했을 때, 그리고 입력, 출력 또는 열에서 지정될 때 RD_RedirectRow 호출됩니다.
적용 대상
DirectErrorRow(Int32, Int32, Int32, Int32)
속성이 참인 에 IDTSOutput100IsErrorOut 대해 행을 PipelineBuffer 보냅니다.
public:
void DirectErrorRow(int row, int outputID, int errorCode, int errorColumn);
public void DirectErrorRow(int row, int outputID, int errorCode, int errorColumn);
member this.DirectErrorRow : int * int * int * int -> unit
Public Sub DirectErrorRow (row As Integer, outputID As Integer, errorCode As Integer, errorColumn As Integer)
매개 변수
- row
- Int32
오류 출력으로 지시할 행의 인덱스.
- outputID
- Int32
행을 PipelineBuffer 보내기 위한 오류 IDTSOutput100 ID입니다.
- errorCode
- Int32
행을 처리하는 동안 발생한 오류 번호입니다.
- errorColumn
- Int32
오류를 일으킨 열의 PipelineBuffer ID입니다.
설명
데이터 흐름 구성 요소가 해당 객체의 IDTSOutput100IsErrorOut 속성이 로 설정 true되어 있을 때 이 메서드를 호출합니다. 컴포넌트는 버퍼 행을 처리하는 과정에서 오류가 발생했을 때, 그리고 입력, 출력 또는 열에 명시된 경우 RD_RedirectRow 이 메서드를 호출합니다.