Lucee Tag Reference
<cfstoredproc>
Executes stored procedures by an ODBC or native connection to a server database. It specifies database connection
information and identifies the stored procedure.
Body
This tag may have a body.
Example
<cfstoredproc [blockfactor=number] [cachedafter=datetime] [cachedwithin=object] [cachename=string] [datasource=object] [debug=boolean] [password=string] procedure=string [result=string] [returncode=boolean] [timeout=number] [username=string]> [</cfstoredproc>]
This tag is also supported within cfscript
<cfscript> storedproc [blockfactor=number] [cachedafter=datetime] [cachedwithin=object] [cachename=string] [datasource=object] [debug=boolean] [password=string] procedure=string [result=string] [returncode=boolean] [timeout=number] [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 |
---|---|---|---|
blockfactor | number | No | Specifies the maximum number of rows to fetch at a time from the server. The range is 1 which is the default to 100. The ODBC driver may dynamically reduce the block factor at runtime. |
cachedafter | datetime | No | This is the age of which the query data can be |
cachedwithin | any | No | possible values are: String "request": If original query was created within the current request, cached query data isused. a timespan (created with function CreateTimeSpan): If original query date falls within the time span, cached query data isused. To use cached data, the current query must use the same SQL statement, data source, query name, user name, and password. |
cachename | string | No | This Attribute is deprecated |
datasource | any | No | The name data source that points to the database that contains the stored procedure. |
debug | boolean | No | Yes or No. Specifies whether debug info will be listed on each statement. Default is No. |
password | string | No | If specified, password overrides the password value specified in the data source setup. |
procedure | string | Yes | The name of the stored procedure on the database server. |
result | string | No | Specifies a name for the structure in which cfstoredproc returns the statusCode and ExecutionTime variables. |
returncode | boolean | No | Yes or No. Specifies whether the tag populates cfstoredproc.statusCode with the status code returned by the stored procedure. Default is No. |
timeout | number | No | timeout for the stored procedure. |
username | string | No | If specified, username overrides the username value specified in the data source setup. |