This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)


SQLExecute[conn, command]
executes a command in an SQL connection.
SQLExecute[conn, command, args]
passes arguments to the command.
  • To use SQLExecute, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • 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 DatabaseExamples` package, as described in Using the Example Databases.