SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
| Introduction
| sql:connect
| sql:query
| sql:insert and sql:column
» | sql:update and sql:column
| sql:delete
| sql:close
| Example
| A Warning about Side-Effects
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# sql:update and sql:column

`sql:update` performs an SQL UPDATE statement. This causes a set of rows to be selected from a given table; columns identified in a child `sql:column` element are then updated with new values.

The attributes are as follows:

connection | The database connection. This is mandatory, the value is an expression, which must evaluate to a database connection object as returned by `sql:connect`.
table | The table to be updated. This is mandatory, and the value must be known statically (it cannot be defined as an attribute value template).
where | The conditions to be applied (the contents of the WHERE clause of the select statement). This is optional, if present the value is an attribute value template whose value is a SQL conditional expression. If omitted, all rows in the table are updated.

`sql:column` is used as a child element of `sql:update`, and identifies the name and value of a column to be included in the UPDATE statement. The name of the column is identified by the `name` attribute, the value may be indicated either by evaluating the expression contained in the `select` attribute, or as the expanded contents of the `sql:column` element. The value is always interpreted as a String. (Remember this is purely a demonstration of extensibility, in a real system there would be a need to cater for SQL columns of other data types).

Next