Ejemplo n.º 1
0
            private static void MergeMissingColumnInformation(string setinfo, ProcedureOutputSet setT, ProcedureOutputSet setE)
            {
                if (setT.ColumnCount != setT.ColumnCount)
                {
                    throw new NotImplementedException("Mismatched output column count. (" + setinfo + ") Expected:" + setT.ColumnCount + " Actual:" + setE.ColumnCount);
                }

                for (int ixCol = 0; ixCol < setT.ColumnCount; ixCol++)
                {
                    ProcedureOutputColumn colT = setT.ColumnAt(ixCol);
                    ProcedureOutputColumn colE = setE.ColumnAt(ixCol);
                    if (colT.HasMissingInformation)
                    {
                        if (!colE.HasMissingInformation)
                        {
                            colT.ApplyMissingInformation(colE);
                        }
                        else
                        {
                            // still not possible! if this is a nested IF the it is ok!
                        }
                    }
                    else
                    {
                        if (!colT.AllowNull.Value && colE.AllowNull.GetValueOrDefault(true))
                        {
                            // NOT NULL => NULL
                            colT.SetAllowNull();
                        }
                        else
                        {
                            // everything's fine here
                        }
                    }
                }
            }
Ejemplo n.º 2
0
 internal void ApplyMissingInformation(ProcedureOutputColumn procedureOutputColumn)
 {
     columnDescriptor = procedureOutputColumn.columnDescriptor;
 }
Ejemplo n.º 3
0
        public static string PrepareOutputColumnName(ProcedureOutputSet procedureOutputResultSet, ProcedureOutputColumn outputColumn, IEnumerable <string> collectedOutputColumnNames, int ix)
        {
            string outputColumnName;

            if (string.IsNullOrEmpty(outputColumn.OutputColumnName))
            {
                //throw new NotImplementedException("Missing column name.");
                if (procedureOutputResultSet.ColumnCount == 1)
                {
                    outputColumnName = "value";
                }
                else
                {
                    outputColumnName = "value" + ix;
                }
            }
            else
            {
                if (outputColumn.OutputColumnName[0] == '@')
                {
                    outputColumnName = outputColumn.OutputColumnName.Substring(1);
                }
                else
                {
                    outputColumnName = outputColumn.OutputColumnName;
                }

                // make the column name unique
                int cnt = collectedOutputColumnNames.Count(x => string.Equals(x, outputColumnName, StringComparison.OrdinalIgnoreCase));
                if (cnt > 0)
                {
                    outputColumnName = outputColumnName + (cnt + 1);
                }
            }

            return(outputColumnName);
        }
Ejemplo n.º 4
0
 internal void AddColumn(ProcedureOutputColumn column)
 {
     resultFragments.Add(column);
 }