MayFlower develops specialty software products for Lotus Notes & Domino.




Chapter 7 - Using the SQL statement (a basic primer)
Table of Contents


The Sentinel does not require a SQL statement. If you leave that section of the form blank, the Sentinel will send SELECT * FROM Tablename (where tablename is the actual name of the Source Table) to the ODBC driver.

Example
This example is based on the ODBC to Notes Task:
1b. Customers from Access.

The fields in the Access table are:
CompanyName
CompanyAddress
CompanyCity
CompanyState
CompanyZip


If you wanted to select three fields, the statement is:
SELECT CompanyName, CompanyAddress, CompanyCity FROM Customers.

If you only wanted CompanyCity = "Boston" , then the WHERE clause is needed.
SELECT CompanyName, CompanyAddress, CompanyCity FROM Customers WHERE CompanyCity = "Boston".

The advantage of this is that less data is moved across your network. Only the data that you want comes through the ODBC driver.

SQL also supports aggregation, which allows you to roll up sales numbers at their source. The syntax is more difficult still. Supported verbs are AVE, SUM, MIN and MAX.