wwsql::SqlBuildUpdateStatementFromObject

This method builds a SQL UPDATE string to be sent to the backend application from a SCATTER NAME type object. The object must contain a key field in order for this method to work.

o.SqlBuildUpdateStatementFromObject(loData, lcFileName, lcPkField, loOrigData, loSQLRecord,llUseNamedParameters)

Return Value

Update command as a string or ""

Parameters

loData
A SCATTER NAME type object that contains the fields that are to be updated. The keyfield must be included in this data block.

lcTableame
The name of the SQL table to be updated.

lcPKField
The name of the PK field that is used to find the record to update. Name has to match the value on the loData object property passed in. Defaults to "PK".

Pass "NONE" to specify you don't want to generate a WHERE clause on the SQL statement. This allows you to create a custom WHERE clause for the SQL statement after the string is returned to you.

loOrigData
Optional - Data to compare current record to, to determine which fields to update in the database

loSqlRecord
Optional - A Record object that contains the actual structure of the fields to update. Pass .F. to ignore and use all fields but loSql.cSkipFields

llUseNamedParameters
Optional - if .T. uses any named parameters added to hold parameter values.

Remarks

The PK field MUST be an integer in order for this function to work.


See also:

Class wwsql

© West Wind Technologies, 1996-2019 • Updated: 07/20/14
Comment or report problem with topic