dim result as c = a5Helper_writeToAuditingLog(cn as SQL::Connection, operationType as C, dataJSON as C, pkFields as C, pkValue as C [, comment as C])
An open connection to the database where the audit table is located.
The type of operation being performed. Can be 'UPDATE', 'INSERT', or 'DELETE'.
JSON text object that contains the old and new data value for the fields being modified.
The name of the primary key field in the table being modified.
The value for the primary key for the record in the table being modified.
An optional comment to include in the audit log, such as the name of the script that performs the update.
Writes an entry to the audit table in an application with auditing enabled.
If auditing is turned on for a web project, will update the auditing log. 'dataJSON' has the data for field old/new values. To get dataJSON, call a5Helper_getAuditInfoFromSQLStatement() before the CRUD operation occurs (for Update and Delete).
dim cn as sql::Connection cn.open("::Name::Northwind") dim args as sql::arguments args.add("primaryKey","ALFKI") args.add("title","Manager") dim sql as c sql = "update Customers set ContactTitle = :title where CustomerID = :primaryKey" 'capture the BEFORE update values dim dataJson as c dataJson = a5Helper_getAuditInfoFromSQLStatement(cn,sql,args.xml) flag = cn.Execute(sql,args) 'write to the auditing table a5Helper_writeToAuditingLog(cn,"Update",dataJson,"CustomerID","ALFKI")
This function does not support multi-row updates.
Used in Web Applications Configured to use an Audit Table