Adobe 38040334 - Dreamweaver CS3 User Manual page 661

Pc
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

Open the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Prepared
2
(Insert, Update, Delete).
The Prepared (Insert, Update, Delete) dialog box appears.
Enter a name for the prepared statement, select a connection to the database containing the records you want to
3
edit, and select the editing operation you want the prepared statement to perform—Insert, Update, or Delete.
Dreamweaver starts the SQL statement for you based on the type of operation you select.
4
Complete the SQL statement.
For information on writing SQL statements that modify databases, consult a Transact-SQL manual.
Use the Variables area to define any SQL variables.
5
In the Param column, enter the name of the SQL parameters used in the SQL statement. In the Run-Time Value
column, enter the form or URL parameter supplying a value to each SQL parameter. For example, if the value to be
assigned to a SQL parameter is supplied by a URL parameter called txtCity, enter the following run-time value:
request.getParameter("txtCity")
Click OK.
6
After you close the dialog box, the JSP code is inserted in your page; when the code runs on the server, it creates a
prepared statement that inserts, updates, or deletes records in the database.
About stored procedures
Although you can use server behaviors to build pages that modify databases, you can also use database manipulation
objects such as stored procedures, ASP command objects, or JSP prepared statements to build the pages.
A stored procedure is a reusable database item that performs some operation on the database. A stored procedure
contains SQL code that can, among other things, insert, update, or delete records. Stored procedures can also alter
the structure of the database itself. For example, you can use a stored procedure to add a table column or even delete
a table.
A stored procedure can also call another stored procedure, as well as accept input parameters and return multiple
values to the calling procedure in the form of output parameters.
A stored procedure is reusable in the sense that you can reuse a single compiled version of the procedure to execute
a database operation a number of times. If you know a database task will be executed more than a few times—or the
same task will be executed by different applications—using a stored procedure to execute that task can make database
operations more efficient.
Note: MySQL and Microsoft Access databases do not support stored procedures.
Add a stored procedure (ColdFusion)
You can use a stored procedure to modify a database. A stored procedure is a reusable database item that performs
some operation on the database.
Before you use a stored procedure to modify a database, make sure the stored procedure contains SQL that modifies
the database in some way. To create and store one in your database, consult your database documentation and a good
Transact-SQL manual.
1
In Dreamweaver, open the page that will run the stored procedure.
In the Bindings panel (Window > Bindings), click the Plus (+) button, and then select Stored Procedure.
2
September 4, 2007
DREAMWEAVER CS3
654
User Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents