Ejemplo n.º 1
0
        public ISLookupOutputColumn(ISLookupComponent parentComponent, LookupOutputColumnOperation lookupColumnOperation, string lookupColumnName, string outputAlias = "", string columnToReplace = "")
        {
            LookupOperation  = lookupColumnOperation;
            _lookupComponent = parentComponent;

            if (LookupOperation == LookupOutputColumnOperation.Add)
            {
                OutputColumn = new ISOutputColumn(_lookupComponent, _output.Name, String.IsNullOrEmpty(outputAlias) ? LookupColumn : outputAlias);
                LookupColumn = lookupColumnName;
                OutputColumn.ErrorRowDisposition = RowDisposition.RD_NotUsed;
                TruncationRowDisposition         = RowDisposition.RD_FailComponent;
            }

            if (LookupOperation == LookupOutputColumnOperation.Replace)
            {
                if (String.IsNullOrEmpty(columnToReplace))
                {
                }
                else
                {
                    InputColumn      = new ISInputColumn(_lookupComponent, _input.Name, columnToReplace, UsageType.UT_READWRITE);
                    InputColumn.Name = outputAlias;
                    LookupColumn     = lookupColumnName;
                    InputColumn.ErrorOrTruncationOperation = "Copy Column";
                    InputColumn.ErrorRowDisposition        = RowDisposition.RD_NotUsed;
                    TruncationRowDisposition = RowDisposition.RD_FailComponent;
                }
            }
        }
Ejemplo n.º 2
0
        public void AssociateWithOutputColumn(string outputColumnName)
        {
            ISOutputColumn outCol = new ISOutputColumn(ParentComponent, Output.Name, outputColumnName, RowDisposition.RD_FailComponent, RowDisposition.RD_FailComponent);

            outCol.SetDataTypeProperties(DataType, Length, Precision, Scale, CodePage);
            outCol.OutputColumn.ExternalMetadataColumnID = ID;

            IDTSOutput100 errorOutput = null;

            for (int o = 0; o < ParentComponent.ComponentMetaData.OutputCollection.Count; o++)
            {
                if (ParentComponent.ComponentMetaData.OutputCollection[o].IsErrorOut == true)
                {
                    errorOutput = ParentComponent.ComponentMetaData.OutputCollection[o];
                }
            }

            bool errorColExists = false;
            int  errorColCount  = errorOutput.OutputColumnCollection.Count;

            for (int e = 0; e < errorColCount; e++)
            {
                if (errorOutput.OutputColumnCollection[e].Name == outputColumnName)
                {
                    errorColExists = true;
                }
            }

            if (!(errorColExists))
            {
                IDTSOutputColumn100 o = errorOutput.OutputColumnCollection.NewAt(errorColCount - 2);
                o.Name = outputColumnName;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Add a Output Column to a script component
 /// </summary>
 /// <param name="parentComponent"></param>
 /// <param name="outputName"></param>
 /// <param name="outputColumnName"></param>
 public ISScriptComponentOutputColumn(ISScriptComponent parentComponent, string outputName, string outputColumnName)
 {
     _parentComponent         = parentComponent;
     _output                  = parentComponent.GetOutputFromName(outputName);
     OutputColumn             = new ISOutputColumn(parentComponent, _output.Name, outputColumnName);
     ErrorRowDisposition      = RowDisposition.RD_NotUsed;
     TruncationRowDisposition = RowDisposition.RD_NotUsed;
 }
Ejemplo n.º 4
0
        public ISOutputColumn AddDerivedColumn(string columnName, string expression, string expressionCols, SSISDataType dataType, int length = 0, int precision = 0, int scale = 0, int codePage = 0, RowDisposition errorRowDisposition = RowDisposition.RD_FailComponent, RowDisposition truncationRowDisposition = RowDisposition.RD_FailComponent)
        {
            if (!(String.IsNullOrEmpty(expressionCols)))
            {
                SetUsageTypeToReadForExpressionCols(expressionCols);
            }

            ISOutputColumn oc = new ISOutputColumn(this, this.GetOutputFromIndex(0).Name, columnName, errorRowDisposition, truncationRowDisposition);

            oc.SetDataTypeProperties(dataType, length, precision, scale, codePage);
            SetCustomPropertyToOutputColumn(oc.Output, oc.OutputColumn, "Expression", expression);
            SetCustomPropertyToOutputColumn(oc.Output, oc.OutputColumn, "FriendlyExpression", expression);
            return(oc);
        }
Ejemplo n.º 5
0
 public ISDerivedColumn(ISDerivedColumnComponent parentComponent, DerivedColumnAction action, string columnName)
 {
     _dervColComponent = parentComponent;
     if (action == DerivedColumnAction.Replace)
     {
         InputColumn = new ISInputColumn(_dervColComponent, _input.Name, columnName, UsageType.UT_READWRITE);
         InputColumn.TruncationRowDisposition = RowDisposition.RD_FailComponent;
         InputColumn.ErrorRowDisposition      = RowDisposition.RD_FailComponent;
     }
     if (action == DerivedColumnAction.New)
     {
         OutputColumn = new ISOutputColumn(_dervColComponent, _output.Name, columnName);
         OutputColumn.TruncationRowDisposition = RowDisposition.RD_FailComponent;
         OutputColumn.ErrorRowDisposition      = RowDisposition.RD_FailComponent;
     }
 }
Ejemplo n.º 6
0
        public void AddLookUpColumnIntoDataFlow(string lookupColumnName, string lookupColumnNameAlias, RowDisposition truncationRowDisposition, SSISDataType dataType, int length, int precision, int scale, int codePage, string inputColumnToReplace = null)
        {
            if (String.IsNullOrEmpty(inputColumnToReplace))
            {
                ISOutputColumn oc = new ISOutputColumn(this, MatchOutput_m.Name, lookupColumnName, RowDisposition.RD_NotUsed, truncationRowDisposition);
                oc.SetDataTypeProperties(dataType, length, precision, scale, codePage);
                SetCustomPropertyToOutputColumn(MatchOutput_m.Name, lookupColumnName, "CopyFromReferenceColumn", lookupColumnName);
                oc.Name = String.IsNullOrEmpty(lookupColumnNameAlias) ? lookupColumnName : lookupColumnNameAlias;
            }

            else
            {
                ISInputColumn ic = new ISInputColumn(this, _input.Name, inputColumnToReplace, UsageType.UT_READWRITE);
                SetCustomPropertyToInputColumn(ic.Input, ic.InputColumn, "CopyFromReferenceColumn", lookupColumnName);
                ic.Name = String.IsNullOrEmpty(lookupColumnNameAlias) ? lookupColumnName : lookupColumnNameAlias;
                _renamedInputCols.Add(new string[] { inputColumnToReplace, ic.Name });
            }
        }