SQLUpdate

SQLUpdate[conn, table, cols, data]
updates data in a table in an SQL connection.

更多信息更多信息

  • 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"Nonethe timeout for the query

范例范例打开所有单元关闭所有单元

基本范例 (1)基本范例 (1)

In[1]:=
Click for copyable input

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 package, as described in Using the Example Databases.

In[2]:=
Click for copyable input

Create a table and insert some data:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
Out[5]=

Update all the data:

In[6]:=
Click for copyable input
Out[6]=
In[7]:=
Click for copyable input
Out[7]=

Insert more data:

In[8]:=
Click for copyable input
In[9]:=
Click for copyable input
Out[9]=

Update only data matching a condition:

In[10]:=
Click for copyable input
Out[10]=
In[11]:=
Click for copyable input
Out[11]=
In[12]:=
Click for copyable input
In[13]:=
Click for copyable input
New to Mathematica? Find your learning path »
Have a question? Ask support »