Accessibility
 
Home > Products > UltraDev > Support > Building Common Applications
Dreamweaver UltraDev Icon Macromedia Dreamweaver UltraDev Support Center - Building Common Applications
Defining the columns of the recordset

This section describes how to define the recordset's columns in the SQL statement. Later sections describe how to define the recordset's rows (records).

Here's the basic SQL syntax to define the columns of a recordset:

SELECT ColumnName1, ColumnName2, ColumnNameX FROM TableName

Note: You can add line breaks, tabs, and other white space to SQL statments to clarify the logic.

If you want to include all the columns of a table in the recordset, you can use the wildcard character *, as follows:

SELECT * FROM TableName

Suppose you're building a search feature for an online employee directory and you want to display only the employees' first name, last name, department, and email address on the results page. If your database table is called EMPLOYEES and the columns containing the information you want are called FIRSTNAME, LASTNAME, DEPARTMENT, and EMAIL, then here's the SQL statement that will produce the desired recordset:

SELECT FIRSTNAME, LASTNAME, DEPARTMENT, EMAIL
FROM EMPLOYEES

Using the sample database that ships with UltraDev, the SQL statement generates the following recordset:

To define the columns of the results recordset in UltraDev:

1 In the Recordset dialog box used to define your SQL variables, enter a name for the recordset and choose a connection.
The connection should be to a database you want the user to search.
2 In the SQL box, enter your SELECT statement defining the columns in the recordset.
Here's an example:
Leave the Recordset dialog box open for now. You'll use it next to add search conditions to the SQL statement so that it finds records in the database table based on the parameters specified by the user. The next four sections outline possible search conditions.

To Table of Contents Back to Previous document Forward to next document