<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="sql-extension" page="update" subpage=""/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: sql:update and sql:column</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: sql:update and sql:column"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>sql:update and sql:column</h1>
      <p><code>sql:update</code> performs an SQL UPDATE statement. This causes a set of rows to be selected from a given table; columns
identified in a child <code>sql:column</code> element are then updated with new values.</p>
      <p>The attributes are as follows:</p>
      <table>
         <tr>
            <td content="para">
               <p>connection</p>
            </td>
            <td content="para">
               <p>The database connection.
This is mandatory, the value is an expression, which must evaluate to a database connection
object as returned by <code>sql:connect</code>.</p>
            </td>
         </tr>
         <tr>
            <td content="para">
               <p>table</p>
            </td>
            <td content="para">
               <p>The table to be updated.
This is mandatory, and the value must be known statically (it cannot be defined as an attribute value template).</p>
            </td>
         </tr>
         <tr>
            <td content="para">
               <p>where</p>
            </td>
            <td content="para">
               <p>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.</p>
            </td>
         </tr>
      </table>
      <p><code>sql:column</code> is used as a child element of <code>sql:update</code>, 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 <code>name</code> attribute,
the value may be indicated either by evaluating the expression contained in the <code>select</code> attribute, or
as the expanded contents of the <code>sql:column</code> 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).</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="delete.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>