Using stored procedures to modify databases (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.
mySQL and Microsoft Access databases do not support stored procedures.
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.
To add a stored procedure to a ColdFusion page:
- 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.
The Stored Procedure dialog box appears.
- Complete the dialog box.
For more information, see Setting the ColdFusion Stored Procedure dialog box options.
- Click OK.
After you close the Stored Procedure dialog box, Dreamweaver inserts ColdFusion code in your page that, when run on the server, calls a stored procedure in the database. The stored procedure in turn performs a database operation, such as inserting a record.
If the stored procedure takes parameters, you can create a page that gathers the parameter values and submits them to the page with the stored procedure. For example, you may create a page that uses URL parameters or an HTML form to gather parameter values from users.