Create an UPDATE 'SET' clause from a (possibly multiple row) SQL source and passed values. The metatable is used to format the column data as expected by the back end table. FieldValList is in the format 'fieldname',fieldvalue, ...
INSERTS cope with 255 columns, however because UPDATES do a pass for the set row and value row they have an effective limit of 127 columns when updating column-from-column When there are more than 127 columns, we can split the insert into two parts using SplitResultString=true, and the second part of the result is passed back in SecondResultString For each column in the destination table, the following is applied :
- if not in the list of passed values,
- if DefaultInsertUnlisted=true, take column val from SQLFromSource with same column name (assume exists)
- if DefaultInsertUnlisted=false, skip column (if column not nullable and has no default value, then flag error)
- if passed, insert the value passed into SET assignment for that column
- if field name preceded with +, SET column val to column in SQLFromSource(same column name if passed value "", passed value otherwise)
- if field name preceded with -, skip column (if column not nullable, then flag error)
The table name for the UPDATE statement
The table name to append to a column name in the SET value list
Automatically generate SQL for columns not defined in the passed name/value list
Generate column insertions for the identity column (otherwise it is omitted)
Automatically add nz() around inserted column names
If true, split the SET clause into two parts, and pass the second part back in SecondResultString
The second SET clause, if SplitResultString=True
The paired column names and values ParamArray, passed as a Variant