MACROMEDIA DREAMWEAVER MX 2004-USING DREAMWEAVER Use Manual page 533

Hide thumbs Also See for DREAMWEAVER MX 2004-USING DREAMWEAVER:
Table of Contents

Advertisement

Creating SQL queries using the Database Items tree
Instead of manually typing SQL statements into the SQL text 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 portion of
the dialog box.
The following examples describe two SQL statements and the steps for creating them using the
advanced Recordset dialog box's Database Items tree.
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:
Expand the Tables branch to display all of the tables in the selected database.
1
Select the Employees table.
2
Click the Select button.
3
Click OK to add the recordset to the Bindings panel.
4
Selecting specific rows from a table and ordering the results
The following example selects two rows from the Employees table, and selects the job type using a
variable that you must define. The results are then ordered by employee name.
SELECT emplNo, emplName
FROM Employees
WHERE emplJob = 'varJob'
ORDER BY emplName
To create this query:
Expand the Tables branch to display all of the tables in the selected database; then expand the
1
table to display the individual table rows.
Employees
Build the SQL statement as follows:
2
Select
emplNo
Select
emplName
Select
emplJob
Select
emplName
Place the insertion point after
3
(include the equal sign).
Define the variable
4
the following values in the Name, Default Value, and Run-Time Value columns:
,
CLERK
Request("job")
Click OK to add the recordset to the Bindings panel.
5
and click the Select button.
and click the Select button.
and click the Where button.
and click the Order By button.
WHERE emplJob
by clicking the Plus (+) button in the Variables area and entering
'varJob'
.
in the SQL text area and type
='varJob'
,
varJob
Defining a recordset
533

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-USING DREAMWEAVER and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents