ddtek:sql-update
This built-in function updates records in a database table.
The syntax is:
declare updating function ddtek:sql-update( row as element()*, column as xs:string, value as item()*, ...) external;where:
rowidentifies the records in the database table to update. Each item in the sequence must be a row element of the database table returned by a previous fn:collection() call.
columnis the column of the database table to update.
valueis the new value for the specified column.
columnandvalueare a pair in a variable argument list. Ifcolumnis specified withoutvalue, an error is raised.The following example updates a record in the holdings table, the record where the userid column equals Minollo and the stockticker column equals PRGS. In this record, the shares column is updated to 500.
ddtek:sql-update( collection("holdings")/holdings[userid="Minollo" and stockticker="PRGS"], "shares", 500)Other examples can be found in the RDBMSUpdate example.