beautypg.com

Create sql queries using the database items tree – Adobe Dreamweaver CS3 User Manual

Page 562

background image

DREAMWEAVER CS3

User Guide

555

The run-time value is usually a URL or form parameter entered by a user in an HTML form field.

6

Click Test to connect to the database and create an instance of the recordset.

If the SQL statement contains run-time references, make sure the Default Value column of the Page Parameters field
contains valid test values before clicking Test.

If successful, a table appears displaying the data in your DataSet. Each row contains a record and each column repre-
sents a field in that record. Click OK to clear the DataSet.

7

If satisfied with your work, click OK.

Define parameters in a SQL statement (ColdFusion, ASP.NET)

Define parameters in a SQL statement; the default value is the value that the parameter should use if no run-time
value is returned.

1

Select a parameter name from the Name pop-up menu.

2

Enter a default value for the parameter in the Default Parameter box, and click OK.

Define parameters in a SQL statement (PHP)

Define parameters in a SQL statement; the default value is the value that the parameter should use if no run-time
value is returned.

1

Enter a parameter name in the Name box.

2

Enter a default value for the parameter in the Default Parameter box.

3

Enter a run-time value for a parameter in the Run-time Value box, and click OK.

Create SQL queries using the Database Items tree

Instead of manually typing SQL statements into the SQL box, you can use the Database Item’s point-and-click
interface to create complex SQL queries. The Database Items tree lets you select database objects and link them using
the SQL SELECT, WHERE, and ORDER BY clauses. After you create a SQL query, you can define any variables using
the Variables area of the dialog box.

The next two examples describe two SQL statements and the steps for creating them using the advanced Recordset
dialog box’s Database Items tree.

Example: Selecting a table

This example selects the entire contents of the Employees table. The SQL statement defining the query appears as
follows:

SELECT * FROM Employees

To create this query, follow these steps.

1

Expand the Tables branch to display all of the tables in the selected database.

2

Select the Employees table.

3

Click the Select button.

Name

Default value

FormFieldName

0001

September 4, 2007