Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
Introducing <cfinsert>
The example in Listing 14.4 demonstrates how to add data to a table using the standard SQL INSERT command. This works very well if you have to provide data for only a few columns, and if those columns are always provided. If the number of columns can vary, using SQL INSERT gets rather complicated.
For example, assume you have two or more data-entry forms for similar data. One might collect a minimal number of fields, whereas another collects a more complete record. How would you create a SQL INSERT statement to handle both sets of data?
You could create two separate templates, with a different SQL INSERT statement in each, but that’s a poor solution. You should always try to avoid having more than one template perform a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access