<cfstoredproc>

edit

Executes stored procedures by an ODBC or native connection to a server database.

It specifies database connection information and identifies the stored procedure.

This tag may have a body.

This tag is also supported within <cfscript>

<cfstoredproc procedure=string timeout=number dataSource=object username=string password=string blockFactor=number debug=boolean returnCode=boolean result=string cachedAfter=datetime cachedWithin=object cacheName=string ><!--- body --->[</cfstoredproc>]
Attribute Description
procedure
string, required
edit

The name of the stored procedure on the database server.

timeout
number, optional
edit

timeout for the stored procedure.

dataSource
object, optional
edit

The name data source that points to the database that contains the stored procedure.

username
string, optional
edit

If specified, username overrides the username value specified in the data source setup.

password
string, optional
edit

If specified, password overrides the password value specified in the data source setup.

blockFactor
number, optional
edit

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.

debug
boolean, optional
edit

Yes or No. Specifies whether debug info will be listed on each statement. Default is No.

returnCode
boolean, optional
edit

Yes or No. Specifies whether the tag populates cfstoredproc.statusCode with the status code returned by the stored procedure. Default is No.

result
string, optional
edit

Specifies a name for the structure in which cfstoredproc returns the statusCode and ExecutionTime variables.

cachedAfter
datetime, optional
edit

This is the age of which the query data can be

cachedWithin
object, optional
edit

possible values are: String "request": If original query was created within the current request, cached query data is used. a timespan (created with function CreateTimeSpan): If original query date falls within the time span, cached query data is used.

To use cached data, the current query must use the same SQL statement, data source, query name, user name, and password.

Unimplemented Attribute(s)

Attribute Description
cacheName
string, optional
edit

This attribute has been deprecated and is non-functional.

* deprecated *

Examples

edit

Sample content for storedproc

<cfstoredproc procedure="games" datasource="dsname">
  <cfprocparam cfsqltype="CF_SQL_VARCHAR" value="#form.game1#">
  <cfprocparam cfsqltype="CF_SQL_VARCHAR" value="#form.game2#">
</cfstoredproc>

See also