SQLBeginTransaction

SQLBeginTransaction[conn]
initiates an SQL transaction.

更多信息更多信息

  • To use SQLBeginTransaction, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • A group of SQL commands grouped into a transaction will only take effect permanently when the transaction is committed. The transaction can be canceled or returned to a savepoint.

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

基本范例 (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.

Open a connection:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input

Begin a transaction:

In[4]:=
Click for copyable input

Insert data:

In[5]:=
Click for copyable input
In[6]:=
Click for copyable input

Commit the transaction:

In[7]:=
Click for copyable input

Select the data:

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