For example consider the table we created earlier:
# table Person +----------+-----------+------------------+-------------+ | LastName | FirstName | Address | DateOfBirth | +----------+-----------+------------------+-------------+ | Smith | John | 5 Friendly Place | 1980-01-01 | +----------+-----------+------------------+-------------+
The SQL command to change every address in the table to '6 London Road' is:
UPDATE Person SET Address = '6 London Road'
To update the data using a web.database cursor we would do the following:
cursor.update('Person','Address','6 London Road')
The table now looks like this:
+----------+-----------+---------------+-------------+ | LastName | FirstName | Address | DateOfBirth | +----------+-----------+---------------+-------------+ | Smith | John | 6 London Road | 1980-01-01 | +----------+-----------+---------------+-------------+
The update() method of a web.database cursor looks like this:
table, fields, values [, where][, autoExecute]) |
True
or False
and by default takes the value of the cursor
object.
See About this document... for information on suggesting changes.