DatabaseLink`
DatabaseLink`

SQLUpdate

SQLUpdate[conn,table,cols,data]

updates data in a table in an SQL connection.

SQLUpdate[conn,table,cols,data,cond]

updates the data matching cond.

Details and Options

  • To use SQLUpdate, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • Returns an integer specifying the number of rows affected by the query.
  • The following option can be given:
  • "Timeout"$SQLTimeoutthe timeout for the query

Examples

Basic Examples  (1)

If you find that the examples in this section 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.

Create a table and insert some data:

Update all the data:

Insert more data:

Update only data matching a condition: