Lucee Tag Reference

<cfinsert>

Inserts records in data sources.

Body

This tag can't have a body.

Example

<cfinsert
	[datasource=object]
	[formfields=string]
	[password=string]
	tablename=string
	[tableowner=string]
	[tablequalifier=string]
	[username=string]>
This tag is also supported within cfscript
<cfscript>
	insert
		[datasource=object]
		[formfields=string]
		[password=string]
		tablename=string
		[tableowner=string]
		[tablequalifier=string]
		[username=string];
</cfscript>

Attributes

The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name Type Required Description
datasource any No Name of the data source that contains your table. 
formfields string No A comma-separated list of form fields to insert. If this attribute is not specified, all
fields in the form are included in the operation. 
password string No If specified, password overrides the password value specified in the ODBC setup. 
tablename string Yes Name of the table you want the form fields inserted in. 
tableowner string No For data sources that support table ownership such as SQL Server, Oracle, and Sybase SQL
Anywhere, use this field to specify the owner of the table. 
tablequalifier string No For data sources that support table qualifiers, use this field to specify the qualifier for the
table. The purpose of table qualifiers varies across drivers. For SQL Server and Oracle, the qualifier
refers to the name of the database that contains the table. For the Intersolv dBase driver, the
qualifier refers to the directory where the DBF files are located. 
username string No If specified, username overrides the username value specified in the ODBC setup.