Query Section


The following items are specified in the query section. They are all related to the data source. If the data source is specified in either a System, User or File DSN it will only be necessary to specify the DSN and the SQL.

NameDescription
dsnData Source Name, configured from the control panel
filedsnfile that specifies connection parameters
drivername of the driver to connect through
servercomputer name to connect to ("." indicates current machine)
databasedatabase
dbqDatabase Qualifier, used to supply a directory for drivers that store tables as single files
useruser name for the data source (if required)
passwordpassword for the data source (if required)
sqlSQL statement to process
definea static symbol definition (multiple allowed)

Defines

Defines are a convenient way to specify fixed values. They are often used when a template is used for more than one profile. A single template might be used for two different sortings or filterings of data. You might want to use a symbol called "Title" so that the two output files could be differentiated.

The simplest way would be with a define.

<query> <sql>Select * From Addresses Order By LastName</sql> <define name="Title">Addresses Sorted by Last Name</define> <define name="BgdColor">Yellow</define> </query>

A much less efficient and cumbersome way to do this would be:

<query> <sql>Select *, 'Addresses Sorted by Last Name' As Title, 'Yellow' As BgdColor From Addresses Order By LastName</sql> </query>