The cfgridupdate tag provides a simple mechanism for updating the database, including inserting and deleting records. It can add, update, and delete records simultaneously. It is convenient because it automatically handles collecting the cfgrid changes from the various form variables, and generates appropriate SQL statements to update your data source.
In most cases, use the cfgridupdate tag to update your database. However, this tag does not provide the complete SQL control that the cfquery tag provides. In particular, the cfgridupdate tag has the following characteristics:
Update the data source with the cfgridupdate tag
The following table describes the highlighted code and its function:
Code |
Description |
---|---|
<cfgridupdate grid="employee_grid" |
Updates the database from the Employee_grid grid. |
datasource="cfdocexamples" |
Updates the cfdocexamples data source. |
tablename="Employee" |
Updates the Employee table. |