50 var table = context.
Query.GetTable(tableName);
52 throw new InvalidOperationException();
55 throw new InvalidOperationException(
"Cannot set a value from a query.");
57 var columnInfos =
new List<ColumnInfo>();
59 var columnName = ObjectName.Parse(name);
60 var colIndex = table.FindColumn(columnName);
62 throw new InvalidOperationException(
String.Format(
"Cannot find column '{0}' in table '{1}'", columnName, table.FullName));
64 columnInfos.Add(table.TableInfo[colIndex]);
67 var assignments =
new List<SqlAssignExpression[]>();
69 foreach (var valueSet
in Values) {
72 for (
int i = 0; i < valueSet.Length; i++) {
73 var columnInfo = columnInfos[i];
75 var value = valueSet[i];
81 var expReturnType = value.ReturnType(context, null);
82 if (!columnInfo.ColumnType.IsComparable(expReturnType))
83 throw new InvalidOperationException();
89 assignments.
Add(valueAssign);
92 return new Prepared(tableName, assignments);
A long string in the system.
static SqlAssignExpression Assign(SqlExpression reference, SqlExpression valueExpression)
static SqlBinaryExpression Add(SqlExpression left, SqlExpression right)
IEnumerable< SqlExpression[]> Values
static SqlBinaryExpression Any(SqlExpression left, SqlExpressionType anyType, SqlExpression right)
static SqlReferenceExpression Reference(ObjectName objectName)
IEnumerable< string > ColumnNames
Defines the base class for instances that represent SQL expression tree nodes.