Passes SQL statements to a data source. Not limited to queries.
Other
<cfquery [name="String"] [result="String"] [dataSource="String"] [dbType="String"] [dbServer="String"] [dbName="String"] [connectString="String"] [username="String"] [password="String"] [maxRows="number"] [blockFactor="number"] [timeout="number"] [cachedAfter="datetime"] [cachedWithin="timespan"] [provider="String"] [providerDSN="String"] [debug="Boolean"] [cachename="String"] [psq="Boolean"] />
[] = Optional attribute
| Name | Type | Required | Default | Description |
| name | String | No | The name query. Must begin with a letter and may consist of letters, numbers, and the underscore character, spaces are not allowed. The query name is used later in the page to reference the query's record set. | |
| result | String | No | ||
| dataSource | String | No | The name of the data source from which this query should retrieve data. | |
| dbType | String | No | The database driver type. | |
| dbServer | String | No | 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 | String | No | The database name, Sybase System 11 driver and SQLOLEDB provider only. If specified, dbName overrides the default database specified in the data source. | |
| connectString | String | No | 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 | String | No | If specified, username overrides the username value specified in the data source setup. | |
| password | String | No | If specified, password overrides the password value specified in the data source setup. | |
| maxRows | number | No | Specifies the maximum number of rows to return in the record set. | |
| blockFactor | number | No | Specifies the maximum number of rows to fetch at a time from the server. The range is 1, default to 100. This parameter applies to ORACLE native database drivers and to ODBC drivers. Certain ODBC drivers may dynamically reduce the block factor at runtime. | |
| timeout | number | No | The maximum number of milliseconds for the query to execute before returning an error indicating that the query has timed-out. This attribute is not supported by most ODBC drivers. timeout is supported by the SQL Server 6.x or above driver. The minimum and maximum allowable values vary, depending on the driver. | |
| cachedAfter | datetime | No | This is the age of which the query data can be | |
| cachedWithin | timespan | No | ||
| provider | String | No | COM provider, OLE-DB only. | |
| providerDSN | String | No | Data source name for the COM provider, OLE-DB only. | |
| debug | Boolean | No | Used for debugging queries. Specifying this attribute causes the SQL statement submitted to the data source and the number of records returned from the query to be returned. | |
| cachename | String | No | This is specific to JTags, and allows you to give the cache a specific name | |
| psq | Boolean | No | preserve single quote or not |