|
There are more effective ways of performing the function previously fulfilled by the Db.update method. At a future date, this method may be removed from the PSL compiler. Therefore, Fidelity recommends that instead of using the Db.update method, you instantiate an object from Db and use the save or bypassSave method. |
Class: Db
Description
This method updates existing records with new values based on the conditions specified in the WHERE clause. This method is equivalent to the SQL UPDATE statement.
Example SQL UPDATE statement:
UPDATE DEP SET BOO=2,IRN=12.5 WHERE BOO=1 AND STAT=4
As of Profile version 6.3, this method supports lowercase variables, object.property, and system variables within the host variable syntax. PSL maps these variables and object references into uppercase host variables.
|
To update a single record with a known access key, or to ensure high performance batch processing and transaction processing requirements where data integrity is controlled in the program procedural logic, use the Db.getRecord method RecordClass.bypassSave method. |
Syntax
Db.update(String tableName,String columnExpression,
String whereClause,String qualifiers)
Parameters
tableName |
The name of the table from which to select rows. The table name must be literal. |
columnExpression |
An expression assigning values to columns in the table. |
whereClause |
A valid SQL WHERE clause. |
qualifiers |
A list of qualifiers to process when executing the method. Qualifiers are separated by slashes (/). The following qualifiers are pre-programmed into the Db.update method. You can, however, include additional qualifiers in the method.
|
Returns
Void
When Became Available
v6.0
Example
// All examples below use a mass-update query
do Db.update("DEP","BOO=2,IRN=12.5","BOO=1 AND STAT=4")
do Db.update("DEP","BOO=:BRANCH,IRN=:XIRN","STAT=4")
// Use of Qualifiers (using 2 lines for readability)
do Db.update("DEP", "BOO=2,IRN=12.5",
"BOO=1 AND STAT=4", "/VALDD/TRIGBRF")