예제 #1
0
        /// <summary>
        /// This method should be called at runtime, so that correct value is returned.
        /// </summary>
        /// <param name="variableDispenser"></param>
        /// <param name="inputBuffer"></param>
        /// <param name="inputLane"></param>
        /// <param name="bufferManager"></param>
        /// <returns></returns>
        public string GetValue(IDTSVariableDispenser100 variableDispenser, PipelineBuffer inputBuffer, IDTSInput100 inputLane, IDTSBufferManager100 bufferManager)
        {
            switch (Binding)
            {
            case HTTPParamBinding.CustomValue:
                return(CustomValue);

            case HTTPParamBinding.Variable:
                DataType type;
                return(Utils.GetVariable(variableDispenser, VariableName, out type).ToString());

            case HTTPParamBinding.InputField:
                int colIndex = bufferManager.FindColumnByLineageID(inputLane.Buffer, inputLane.InputColumnCollection[InputColumnName].LineageID);
                return(inputBuffer[colIndex].ToString());

            default:
                throw new ApplicationException("Unhandled HTTPBinding type.");
            }
        }
예제 #2
0
        public static int First(this IDTSBufferManager100 manager, IDTSInput100 input)
        {
            var column = input.InputColumnCollection[0];

            return(manager.FindColumnByLineageID(input.Buffer, column.LineageID));
        }
예제 #3
0
 public static int FindColumnByName(this IDTSBufferManager100 manager, string name, IDTSInput100 input, IDTSOutput100 output)
 {
     return((from IDTSOutputColumn100 column in output.OutputColumnCollection
             where column.Name == name
             select manager.FindColumnByLineageID(input.Buffer, column.LineageID)).FirstOrDefault());
 }
예제 #4
0
        //public SSISOutputColumn()
        //{
        //    _customPropertyCollection = new Dictionary<string, SSISProperty>();
        //}

        public SSISOutputColumn(IDTSOutputColumn100 outputColumn, IDTSBufferManager100 bufferManager, int bufferID)
        {
            _customPropertyCollection = new Dictionary <string, SSISProperty>();
            _name = "_" + System.Text.RegularExpressions.Regex.Replace(outputColumn.Name, @"[^a-zA-Z0-9]", String.Empty); //.Replace(" ", String.Empty).Replace("_", String.Empty).Replace("@", String.Empty);
            //_truncationRowDisposition = outputColumn.TruncationRowDisposition;
            _identificationString = outputColumn.IdentificationString;
            //_errorRowDisposition = outputColumn.ErrorRowDisposition;
            _lineageID = outputColumn.LineageID;
            _datatype  = outputColumn.DataType;
            for (int j = 0; j < outputColumn.CustomPropertyCollection.Count; j++)
            {
                SSISProperty newProperty = new SSISProperty();
                newProperty.Name  = outputColumn.CustomPropertyCollection[j].Name;
                newProperty.Value = outputColumn.CustomPropertyCollection[j].Value;
                _customPropertyCollection.Add(newProperty.Name, newProperty);
            }

            if (_customPropertyCollection.Count > 0)
            {
                switch ((Utilities.usageOfColumnEnum)_customPropertyCollection[ManageProperties.usageOfColumn].Value)
                {
                case Utilities.usageOfColumnEnum.RowType:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = true;
                    _isDerived     = false;
                    break;

                case Utilities.usageOfColumnEnum.Passthrough:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = false;
                    break;

                case Utilities.usageOfColumnEnum.Ignore:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = true;
                    break;

                case Utilities.usageOfColumnEnum.Key:
                    _isMasterOrKey = true;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = true;
                    break;

                case Utilities.usageOfColumnEnum.MasterValue:
                    _isMasterOrKey = true;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = false;
                    break;

                case Utilities.usageOfColumnEnum.RowData:
                    _isMasterOrKey = false;
                    _isRowData     = true;
                    _isRowType     = false;
                    _isDerived     = false;
                    break;

                default:
                    _isMasterOrKey = false;
                    _isRowData     = false;
                    _isRowType     = false;
                    _isDerived     = true;
                    break;
                }

                if (_customPropertyCollection.ContainsKey(ManageProperties.keyOutputColumnID))
                {
                    if ((int)_customPropertyCollection[ManageProperties.keyOutputColumnID].Value > 0)
                    {
                        _isDerived = true;
                    }
                }
            }
            else
            {
                _isMasterOrKey = false;
                _isRowData     = false;
                _isRowType     = false;
                _isDerived     = false;
            }

            if (bufferManager != null)
            {
                _outputBufferID = bufferManager.FindColumnByLineageID(bufferID, outputColumn.LineageID);
            }
        }