cfupdate

Updates records in a data source from data in a CFML form
or form Scope.

  <cfupdate datasource="" tablename="">

 cfupdate(datasource="", tablename="");

Attribute Reference

datasource string
Required

Name of the data source that contains the table

tablename string
Required

Name of table to update.
For ORACLE drivers, must be uppercase.
For Sybase driver: case-sensitive; must be in same case
as used when the table was created

tableowner string

For data sources that support table ownership (for example,
SQL Server, Oracle, Sybase SQL Anywhere), the table owner.

tablequalifier string

For data sources that support table qualifiers. The purpose
of table qualifiers is as follows:
SQL Server and Oracle: name of database that contains
table
Intersolv dBASE driver: directory of DBF files

username string

Overrides username value specified in ODBC setup.

password string

Overrides password value specified in ODBC setup.

formfields string

Comma-delimited list of form fields to update.

If a form field is not matched by a column name in the
database, CFML throws an error.

The formFields list must include the database table primary
key field, which must be present in the form. It can be
hidden.

Examples
Sample code using the cfupdate tag

Uses the cfupdate function to update a record in the a users table based on a list form fields. The primary key must be included in the list of fields

cfupdate( datasource="myDsn", tablename="users", formFields="userId,firstName,lastName,emailAddress" );

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub