executes a command in an SQL connection.
passes arguments to the command.
manages the opening and closing of conn.
Details and Options
- To use SQLExecute, you first need to load DatabaseLink using Needs["DatabaseLink`"].
- Use this function with caution, as you can lose data permanently!
- Options support and behavior varies with driver, driver version, and RDBMS type.
- 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:
"ColumnSymbols" None symbols to be associated with results "EscapeProcessing" True translate escaped JDBC function syntax "FetchSize" Automatic JDBC driver hint for filling result sets "GetAsStrings" False return all results as strings "GetGeneratedKeys" False return keys associated with updated records "MaxFieldSize" Automatic byte limit for variable-length column types "MaxRows" Automatic the maximum number of rows to return "ShowColumnHeadings" False whether to return headings with the results "Timeout" $SQLTimeout the timeout for the query "BatchSize" 1000 queries with parameters will be processed incrementally in batches of this size "JavaBatching" True perform parameter batching in Java layer instead of Wolfram Language layer
Examplesopen allclose all
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.
Selecting Data (1)
Creating Tables (1)
Working with Dates and Times (1)
Generalizations & Extensions (1)
Supply a function to operate on column names and results. If column headings have not been requested, the first argument to the function will be Null:
Section 13.4 of the JDBC 4.0 Specification contains further information on escape processing and supported functions.
The "FetchSize" option suggests to the JDBC driver a number of rows to fetch on each visit to the database. Increasing this parameter reduces the amount of network traffic required to execute a query, at the cost of memory used:
Possible Issues (1)
When using a parameterized SQLExecute with this RDBMS and driver, only the last generated key is returned: