Updating Data with Raw SQL
If you find that the examples in this tutorial do not work as shown, you may need to install or restore the example database with the "DatabaseLink`DatabaseExamples`" package, as described in "Using the Example Databases".
When updating data, the result of SQLExecute is an integer specifying the number of rows affected by the query.
As discussed in "Creating Tables with Raw SQL", the ADDRESSES and MAILER tables should be created.
This executes an SQL statement that updates a row in the MAILER table. This query updates the SENDMAILER column based on the value of USERNAME. Many update statements may be created using conditions that work with values in columns.
Using prepared statements, you can dynamically create SQL statements that update data within the database. You can combine this with a simple Wolfram Language function. This example updates the address for a particular user.
The same restrictions that apply to inserts also apply to updates. Thus, if you try to update an ADDRESS value to equal the ADDRESS value of another row, an error will be returned; this table requires them to be unique.