CFML Reference
|
|
ColdFusion Tags
|
cfgridupdate
Description
Used in a cfgrid
, cfgridupdate
allows you to perform updates to data sources directly from edited grid data. The cfgridupdate
tag provides a direct interface with your data source.
The cfgridupdate
tag applies delete
row actions first, then INSERT row actions, and then UPDATE row actions. If an error is encountered, row processing stops.
Category
Forms tags
Syntax
<cfgridupdate grid = "gridname"
dataSource = "data source name"
dbType = "type"
dbServer = "dbms"
dbName = "database name"
tableName = "table name"
connectString = "connection string"
username = "data source username"
password = "data source password"
tableOwner = "table owner"
tableQualifier = "qualifier"
provider = "COMProvider"
providerDSN = "datasource"
keyOnly = "Yes" or "No">
See also
cfapplet,
cfform,
cfinput,
cfselect,
cfslider,
cftextinput,
cftree,
cfgrid,
cfgridcolumn,
cfgridrow
Attributes
Attribute |
Description |
grid
|
Required. The name of the cfgrid form element that is the source for the update action.
|
dataSource
|
Required for all dbType operations except dbType = "dynamic" . The name of the data source for the update action.
|
dbType
|
Optional. The database driver type:
- dynamic Connect to an ODBC data source that is not defined in the ColdFusion Administrator. When you use this attribute value, you must specify all the ODBC connection information using the
connectstring attribute.
- ODBC (default) ODBC driver.
- Oracle73 Oracle 7.3 native database driver. Using this option, the ColdFusion Server computer must have Oracle 7.3.4.0.0 (or greater) client software installed.
- Oracle80 Oracle 8.0 native database driver. Using this option, the ColdFusion Server computer must have Oracle 8.0 (or greater) client software installed.
- Sybase11 Sybase System 11 native database driver. Using this option, the ColdFusion Server computer must have Sybase 11.1.1 (or greater) client software installed. Sybase patch ebf 7729 is recommended.
- OLEDB OLE DB provider. If specified, this database provider overrides the driver type specified in the ColdFusion Administrator.
- DB2 DB2 5.2 native database driver.
- Informix73-Informix73 native database driver.
|
dbServer
|
Optional. For native database drivers and the SQLOLEDB provider, specifies the name of the database server computer. If specified, dbServer overrides the server specified in the data source.
|
dbName
|
Optional. The database name (Sybase System 11 driver and SQLOLEDB provider only). If specified, dbName overrides the default database specified in the data source.
|
tableName
|
Required. The name of the table to update. Note the following:
- ORACLE drivers This specification must be in uppercase.
- Sybase driver This specification is case-sensitive and must be in the same case as that used when the table was created
|
connectString
|
Required for dbType = "dynamic" ; optional for all others. The contents of a connection string to send to the ODBC server. When connecting to a data source defined in the ColdFusion Administrator, you can use this attribute to specify additional connection details or to override connection information specified in the Administrator. If you are dynamically connecting to a datasource by specifying dbType = "dynamic" , the connection string must specify all required ODBC connection attributes.
|
username
|
Optional. If specified, username overrides the username value specified in the ODBC setup.
|
password
|
Optional. If specified, password overrides the password value specified in the ODBC setup.
|
tableOwner
|
Optional. 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
|
Optional. 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.
|
provider
|
Optional. COM provider (OLE-DB only).
|
providerDSN
|
Optional. Data source name for the COM provider (OLE-DB only).
|
keyOnly
|
Optional. Yes or No. Yes specifies that in the update action, the WHERE criteria is confined to the key values. No specifies that in addition to the key values, the original values of any changed fields are included in the WHERE criteria. Default is Yes.
|
Example
<!--- This example shows the cfgrid, cfgridcolumn, cfgridrow,
and cfgridupdate tags in action --->
...
<!--- If the gridEntered form field has been tripped,
perform the gridupdate on the table specified in the database.
Using the default value keyonly = yes allows us to change only
the information that differs from the previous grid --->
<cfif IsDefined("form.gridEntered") is True>
<cfgridupdate grid = "FirstGrid" dataSource = "cfsnippets"
tableName = "CourseList" keyOnly = "Yes">
</cfif>
...
Copyright © 2001, Macromedia Inc. All rights reserved. |
|