DatabaseLink SQL Operations >

SQLExecute

SQLExecute
executes a command in an SQL connection.
SQLExecute
passes arguments to the command.
  • Use this function with caution, as you can lose data permanently!
  • Returns an integer specifying the number of rows affected by the query. Returns $Failed if an error is encountered when dropping a table.
  • The following options can be given:
"GetAsStrings"Falsereturn the results as strings
"MaxRows"Automaticthe maximum number of rows to return
"ShowColumnHeadings"Falsewhether to return headings with the results
"Timeout"Nonethe timeout for the query
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 .
Select data:
Create a table:
Insert data:
Select data:
Update data:
Delete data:
Drop the table:
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 .
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
Select data:
In[3]:=
Click for copyable input
Out[3]=
Create a table:
In[4]:=
Click for copyable input
Out[4]=
Insert data:
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=
Select data:
In[7]:=
Click for copyable input
Out[7]=
Update data:
In[8]:=
Click for copyable input
Out[8]=
In[9]:=
Click for copyable input
Out[9]=
Delete data:
In[10]:=
Click for copyable input
Out[10]=
Drop the table:
In[11]:=
Click for copyable input
Out[11]=
In[12]:=
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.
Select data matching a condition:
Select the same data using a prepared statement:
Specify a column in a prepared statement:
Give a sequence of arguments in a prepared statement:
Apply a database function to the selected data:
Select only distinct values:
Group values:
Select a range of results:
Join data from multiple tables:
Update data matching a condition:
Use a prepared statement:
Delete data matching a condition:
Use a prepared statement:
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team