Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Argument Sequences

The Data Commands section describes how database commands can be constructed using DatabaseLink. It shows how both Mathematica-Based Queries and SQL-Based Queries can be used, depending upon your experience with Mathematica and knowledge of SQL. This section discusses a feature of SQL queries that allows argument sequences to be given. 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.

Argument sequences.

If you want to use one argument in an SQL statement that holds a sequence of several values, you can use SQLArgument. This is particularly useful for selects and inserts in tables that have many columns. With selects, you can dynamically specify multiple tables and columns, and with inserts you can dynamically specify multiple columns and values.

To demonstrate this, load DatabaseLink and connect to the publisher database.

In[7]:=

Now, you can execute a select query using SQLArgument. Notice how the statement refers to two arguments as `1` arguments. This makes the statement simpler since it saves having to number the arguments individually.

In[9]:=
Out[9]=

This closes the connection.

In[10]:=

It should also be noted that SQLArgument is not supported in Mathematica-based queries.

Basic result set functions.

Result set position functions.

Examples of result set position functions.

Advanced result set functions.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: