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

Chapter 5. Interacting with Databases: Inserting, Updating, and Deleting

Chapter 5. Interacting with Databases: Inserting, Updating, and Deleting

In Chapter 4, “Interacting with Databases: Retrieving Data,” you saw how to use ColdFusion to make SQL SELECT queries that retrieve data from a relational database. This capability is certainly useful, but it is not the limit of ColdFusion's ability to work with databases. You also can use the <cfquery> tag you used in Chapter 4 to implement queries that put new records into databases and modify or eliminate records already in databases. What's different in these cases is that you use different SQL commands. Specifically, you use INSERT to add a new record, UPDATE to modify an existing record, and DELETE to eliminate an existing record.

Very often these functions are useful on the “administrative side” of a Web-based database. For example, a sales system would have information on customers that sales representatives and managers could look up by means of SELECT queries. But such a system would also need administrative functions in which marketing or sales support personnel enter information about new customers, change data about existing customers, or delete names of people who are no longer customers. ColdFusion can support these functions as easily as it does those that make use of SELECT queries.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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