Database exceptions

The following additional variables are available whenever the exception type is database:

Property variable

Description

cfcatch.NativeErrorCode

The native error code associated with this exception. Database drivers typically provide error codes to assist in the diagnosis of failing database operations. The values assumed by cfcatch.NativeErrorCode are driver-dependent.

If no error code is provided, the value of cfcatch.nativeErrorCode is -1. The value is 0 for queries of queries.

cfcatch.SQLState

The SQLState code associated with this exception. Database drivers typically provide error codes to assist in the diagnosis of failing database operations. SQLState codes are more consistent across database systems than native error codes.

If the driver does not provide an SQLState value, the value of cfcatch.SQLState is -1.

cfcatch.Sql

The SQL statement sent to the data source.

cfcatch.queryError

The error message as reported by the database driver.

cfcatch.where

If the query uses the cfqueryparam tag, query parameter name-value pairs.