Click or drag to resize

SQLErrorInfo Class

X#
Describe a SQL error.
Inheritance Hierarchy
Object
  Exception
    Error
      SQLErrorInfo

Namespace:  VO
Assembly:  VOSQLClasses (in VOSQLClasses.dll) Version: 2.21
Syntax
 CLASS SQLErrorInfo INHERIT Error
Request Example View Source

The SQLErrorInfo type exposes the following members.

Constructors
  NameDescription
Public methodSQLErrorInfo
Construct a SQLErrorInfo object.
Top
Properties
  NameDescription
Public propertyArg
A string representing the argument supplied to an operator or function when an argument error occurs.
(Inherited from Error.)
Public propertyArgNum
A numeric value representing the number of the argument supplied to an operator or function when an argument error occurs.
(Inherited from Error.)
Public propertyArgs
An array of the arguments supplied to an operator or function when an argument error occurs.
(Inherited from Error.)
Public propertyArgType
A numeric value representing the data type of the argument that raised the error.
(Inherited from Error.)
Public propertyArgTypeReq
A numeric value representing the expected type of the argument that raised the error.
(Inherited from Error.)
Public propertyArgTypeReqType
The system type representing the expected type of the argument that raised the error.
(Inherited from Error.)
Public propertyArgTypeType
The system type representing the data type of the argument that raised the error.
(Inherited from Error.)
Public propertyCallFuncSym
A symbol representing the calling function of the function in which the error occurred.
(Inherited from Error.)
Public propertyCanDefault
A logical value indicating whether the subsystem can perform default error recovery for the error condition.
(Inherited from Error.)
Public propertyCanRetry
A logical value indicating whether the subsystem can retry the operation that caused the error condition.
(Inherited from Error.)
Public propertyCanSubstitute
A logical value indicating whether a new result can be substituted for the operation that produced the error condition.
(Inherited from Error.)
Public propertyCargo
A value of any data type unused by the Error system. It is provided as a user-definable slot, allowing arbitrary information to be attached to an Error object and retrieved later
(Inherited from Error.)
Public propertyDescription
A string that describes the error condition.
(Inherited from Error.)
Public propertyErrorFlag
A logical value representing whether a SQL error has just occurred.
Public propertyErrorList
Public propertyErrorMessage
A string that contains the SQL error message.
Public propertyErrorMessageLen
A numeric value that represents the SQL error message length.
Public propertyFileHandle
A numeric value representing the file handle supplied to a function when an file error occurs.
(Inherited from Error.)
Public propertyFileName
A string representing the name used to open the file associated with the error condition.
(Inherited from Error.)
Public propertyFuncPtr
A pointer to the function in which the error occurred.
(Inherited from Error.)
Public propertyFuncSym
A string representing the name of the function or method in which the error occurred.
(Inherited from Error.)
Public propertyGencode
An integer numeric value representing a Visual Objects generic error code.
(Inherited from Error.)
Public propertyGenCodeText
An string containing the description of the Gencode.
(Inherited from Error.)
Public propertyMaxSize
A numeric value representing a boundary condition for an operation (such as string overflow or array bound error).
(Inherited from Error.)
Public propertyMethodSelf
An object representing the SELF of the method in which the error occurred.
(Inherited from Error.)
Public propertyNativeError
A numeric value that represents the native SQL error.
Public propertyOperation
A string that describes the operation being attempted when the error occurred.
(Inherited from Error.)
Public propertyOSCode
A value of 0 indicates that the error condition was not caused by an error from the operating system.
(Inherited from Error.)
Public propertyOSCodeText
Descripion of the OSCode
(Inherited from Error.)
Public propertyReturnCode
A numeric value that represents the SQL return code value (for example, SQL_ERROR, SQL_SUCCESS_WITH_INFO, etc.).
Public propertySeverity
A constant indicating the severity of the error condition.
(Inherited from Error.)
Public propertySQLState
A string that contains the SQL error state (for example, S1000, which is a general error).
Public propertyStack
Call stack from the moment where the error object was created
(Inherited from Error.)
Public propertyStackTrace (Inherited from Error.)
Public propertySubCode
An integer numeric value representing a subsystem-specific error code.
(Inherited from Error.)
Public propertySubCodeText
An string containing the description of the SubCode.
(Inherited from Error.)
Public propertySubstituteType
A numeric value representing the type of the new result that the error handler substitutes for the operation that produced the error condition.
(Inherited from Error.)
Public propertySubSystem
A string representing the name of the subsystem generating the error.
(Inherited from Error.)
Public propertyTries
An integer numeric value representing the number of times the failed operation has been attempted.
(Inherited from Error.)
Top
Methods
  NameDescription
Public methodSetStackTrace (Inherited from Error.)
Public methodShowErrorMsg
Display an SQL error message.
Public methodThrow (Overrides Throw.)
Public methodToString
Creates and returns a string representation of the current exception.
(Inherited from Error.)
Top
Extension Methods
  NameDescription
Public Extension MethodGetInnerException (Defined by Error.)
Top
Remarks
An SQLErrorInfo object will be automatically created by the SQL classes (SQLConnection, SQLStatement, SQLSelect, SQLTable, and so on) whenever an error occurs. To retrieve the error, use the SQLSelect:ErrInfo access.
Examples
The following traps an error that is received and creates an SQLErrorInfo object:
X#
 1LOCAL oSQLErrorInfo AS OBJECT
 2LOCAL oConnection AS OBJECT
 3LOCAL oSelect AS OBJECT
 4// Create the object for SQLConnection
 5oConnection := SQLConnection{"sample", "dba",;
 6"sql"}
 7// Create the object for SQLSelect
 8oSelect := SQLSelect{"SELECT * FROM lab",
 9oConnection}
10// Test for invalid argument
11IF SQLGetStmtOption(oSelect:StatementHandle,;
1230000, NULL_PTR) # SQLSuccess
13// Now, create SQLErrorInfo object to pick up
14// last error. The first two parameters are
15// optional, followed by the environment handle,
16// the connection handle, followed by the
17// statement handle from SQLSelect.
18oSQLErrorInfo := SQLErrorInfo{ , , ;
19oConnection:EnvHandle,;
20oConnection:ConnHandle,;
21oSelect:StatementHandle}
22ENDIF
23?oSQLErrorInfo:ErrorFlag
24?oSQLErrorInfo:ErrorMessage
25?oSQLErrorInfo:NativeError
26?oSQLErrorInfo:SQLState
See Also

Reference