Logo
Home Cart [Log In] About Us Contact Us

Object Reference

xf_ScripterSQL Script Generation and Processing

Public Function CreateUpdateStatement (
dbs As DAO.Database,
TableName As String,
UpdateFieldList As String,
KeyFieldList As String,
Optional WhereOrOrderByClause As String = ""
) As String

Generate update statements to update data in specified fields of table TableName

dbs as DAO.Database

The database object to generate the script against

TableName as String

The name of the table to create

UpdateFieldList as String

Generate SET clauses for these fields/columns

KeyFieldList as String

Generare WHERE clause for these key columns

Optional WhereOrOrderByClause as String = ""

A full SQL WHERE and/or ORDER BY clause restricting or ordering the dataset used to generate the UPDATE statements

Call Template:

Dim s As String
s = xf.Scripter.CreateUpdateStatement(dbs, TableName, UpdateFieldList, KeyFieldList)
s = xf.Scripter.CreateUpdateStatement(dbs, TableName, UpdateFieldList, KeyFieldList, WhereOrOrderByClause)

See Also:

Example 1:

Debug.Print CreateUpdateStatement("tblKeyNames", "KeyValDesc,KeyValDescShort", "KeyName,KeyVal", "WHERE keyname='ReconStatusStr'")

returning three rows as an INSERT statements ...

UPDATE tblKeyNames SET KeyValDesc='Unmatched',KeyValDescShort='Unmatched'
WHERE KeyName='ReconStatusStr' AND KeyVal='U'
UPDATE tblKeyNames SET KeyValDesc='Partially Matched',KeyValDescShort='Partial'
WHERE KeyName='ReconStatusStr' AND KeyVal='P'
UPDATE tblKeyNames SET KeyValDesc='Matched',KeyValDescShort='Matched'
WHERE KeyName='ReconStatusStr' AND KeyVal='M'
Contact Us :: About Us :: Policies :: email: infspamo@arrospamw-of-tispamme.com    © 2012 Arrow Of Time Pty Ltd