/usr/share/doc/cl-sql/html/update-records.html is in cl-sql 6.5.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>UPDATE-RECORDS</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="CLSQL Users' Guide" /><link rel="up" href="ref-fdml.html" title="Functional Data Manipulation Language (FDML)" /><link rel="prev" href="insert-records.html" title="INSERT-RECORDS" /><link rel="next" href="delete-records.html" title="DELETE-RECORDS" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">UPDATE-RECORDS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="insert-records.html">Prev</a> </td><th width="60%" align="center">Functional Data Manipulation Language (FDML)</th><td width="20%" align="right"> <a accesskey="n" href="delete-records.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="update-records"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>UPDATE-RECORDS — Updates the values of existing records.<strong>Function</strong></p></div><div class="refsect1"><a id="idp62371472"></a><h2>Syntax</h2><pre class="synopsis">
<code class="function">update-records</code> <em class="replaceable"><code>table</code></em> &key <em class="replaceable"><code>attributes</code></em> <em class="replaceable"><code>values</code></em> <em class="replaceable"><code>av-pairs</code></em> <em class="replaceable"><code>where</code></em> <em class="replaceable"><code>database</code></em> => <span class="returnvalue"></span></pre></div><div class="refsect1"><a id="idp62376624"></a><h2>Arguments and Values</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>table</code></em></span></dt><dd><p>
A string, symbol or symbolic SQL expression representing
the name of a table existing in
<em class="parameter"><code>database</code></em>.
</p></dd><dt><span class="term"><em class="parameter"><code>attributes</code></em></span></dt><dd><p>
A list of attribute identifiers or <code class="constant">NIL</code>.
</p></dd><dt><span class="term"><em class="parameter"><code>values</code></em></span></dt><dd><p>
A list of attribute values or <code class="constant">NIL</code>.
</p></dd><dt><span class="term"><em class="parameter"><code>av-pairs</code></em></span></dt><dd><p>
A list of attribute identifier/value pairs or <code class="constant">NIL</code>.
</p></dd><dt><span class="term"><em class="parameter"><code>where</code></em></span></dt><dd><p>
A symbolic SQL expression.
</p></dd><dt><span class="term"><em class="parameter"><code>database</code></em></span></dt><dd><p>A
<a class="glossterm" href="glossary.html#gloss-database-object"><em class="glossterm">database
object</em></a>. This will default to the value
of <span class="symbol">*default-database*</span>.</p></dd></dl></div></div><div class="refsect1"><a id="idp62394416"></a><h2>Description</h2><p>
Updates the attribute values of existing records satsifying
the SQL expression <em class="parameter"><code>where</code></em> in the table
specified by <em class="parameter"><code>table</code></em> in
<em class="parameter"><code>database</code></em> which defaults to
<span class="symbol">*default-database*</span>.
</p><p>
There are three ways of specifying the values to update for
each row. In the first, <em class="parameter"><code>values</code></em> contains
a list of values to use in the update and
<em class="parameter"><code>attributes</code></em> and
<em class="parameter"><code>av-pairs</code></em> are <code class="constant">NIL</code>. This can be used
when values are supplied for all attributes in
<em class="parameter"><code>table</code></em>. In the second,
<em class="parameter"><code>attributes</code></em> is a list of column names,
<em class="parameter"><code>values</code></em> is a corresponding list of
values and <em class="parameter"><code>av-pairs</code></em> is <code class="constant">NIL</code>. In the
third, <em class="parameter"><code>attributes</code></em> and
<em class="parameter"><code>values</code></em> are <code class="constant">NIL</code> and
<em class="parameter"><code>av-pairs</code></em> is an alist of (attribute
value) pairs.
</p></div><div class="refsect1"><a id="idp62407552"></a><h2>Examples</h2><pre class="screen">
(select [first-name] [last-name] [email]
:from [employee]
:where [= [emplid] 1]
:field-names nil)
=> (("Vladimir" "Lenin" "lenin@soviet.org"))
(update-records [employee]
:av-pairs'((first_name "Yuri")
(last_name "Gagarin")
(email "gagarin@soviet.org"))
:where [= [emplid] 1])
=>
(select [first-name] [last-name] [email]
:from [employee]
:where [= [emplid] 1]
:field-names nil)
=> (("Yuri" "Gagarin" "gagarin@soviet.org"))
</pre></div><div class="refsect1"><a id="idp62409728"></a><h2>Side Effects</h2><p>
Modifications are made to the underlying database.
</p></div><div class="refsect1"><a id="idp62411120"></a><h2>Affected by</h2><p>
None.
</p></div><div class="refsect1"><a id="idp62412464"></a><h2>Exceptional Situations</h2><p>
An error of type <span class="symbol">sql-database-data-error</span> is
signalled if <em class="parameter"><code>table</code></em> is not an existing
table in <em class="parameter"><code>database</code></em>, if the specified
attributes are not found or if the SQL statement resulting
from the symbolic expression <em class="parameter"><code>where</code></em> does
not return a Boolean value.
</p><p>If the execution of the SQL query leads to any errors, an
error of type <span class="errortype">sql-database-error</span> is
signalled.</p></div><div class="refsect1"><a id="idp62417408"></a><h2>See Also</h2><p>
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="link" href="insert-records.html" title="INSERT-RECORDS"><code class="function">insert-records</code></a></td></tr><tr><td><a class="link" href="delete-records.html" title="DELETE-RECORDS"><code class="function">delete-records</code></a></td></tr></table><p>
</p></div><div class="refsect1"><a id="idp62421968"></a><h2>Notes</h2><p>
None.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="insert-records.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref-fdml.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="delete-records.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">INSERT-RECORDS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> DELETE-RECORDS</td></tr></table></div></body></html>
|