• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13.  Using Forms to Add or Change Data > Deleting Data with ColdFusion

Deleting Data with ColdFusion

Unlike adding and updating data, ColdFusion provides no efficient way to delete data. DELETE is always a dangerous operation, and the ColdFusion developers didn't want to make it too easy to get rid of the wrong data.

To delete data in a ColdFusion template, you must use the SQL DELETE statement, as shown in Listing 13.12. The code first checks to ensure that a FilmID was passed; it terminates if the URL.FilmID field is not present. If a FilmID is passed, a <CFQUERY> is used to pass a SQL DELETE statement to the data source.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint