Beispiel #1
0
        private static List <Column> GetInsertColumns(SqlInsertSpecification spec, Table table)
        {
            if (spec.TargetColumns == null)
            {
                return(table.Columns);
            }
            var columns    = new List <Column>( );
            var columnRefs = spec.TargetColumns as SqlColumnRefExpressionCollection;

            foreach (var columnRef in columnRefs)
            {
                var column = table.Columns.FirstOrDefault(c => c.Name == columnRef.ColumnName.Value);
                if (column == null)
                {
                    throw new SqlInvalidColumnNameException(columnRef.ColumnName.Value);
                }

                columns.Add(column);
            }

            return(columns);
        }
Beispiel #2
0
 public override void Visit(SqlInsertSpecification codeObject)
 {
 }
Beispiel #3
0
        private Table GetInsertTable(Dictionary <string, Table> tables, SqlInsertSpecification spec)
        {
            var target = spec.Target as SqlTableRefExpression;

            return(Helper.GetTableFromObjectId(target.ObjectIdentifier, tables, ((MemoryDbConnection)_Command.Connection).TempTables));
        }