SQLErrorInfo 类 |
命名空间: VO
SQLErrorInfo 类型公开以下成员。
名称 | 说明 | |
---|---|---|
SQLErrorInfo |
构造一个 SQLErrorInfo 对象。
|
名称 | 说明 | |
---|---|---|
Arg | A string representing the argument supplied to an operator or function when an argument error occurs. (继承自 Error。) | |
ArgNum | A numeric value representing the number of the argument supplied to an operator or function when an argument error occurs. (继承自 Error。) | |
Args | An array of the arguments supplied to an operator or function when an argument error occurs. (继承自 Error。) | |
ArgType | A numeric value representing the data type of the argument that raised the error. (继承自 Error。) | |
ArgTypeReq | A numeric value representing the expected type of the argument that raised the error. (继承自 Error。) | |
ArgTypeReqType | The system type representing the expected type of the argument that raised the error. (继承自 Error。) | |
ArgTypeType | The system type representing the data type of the argument that raised the error. (继承自 Error。) | |
CallFuncSym | A symbol representing the calling function of the function in which the error occurred. (继承自 Error。) | |
CanDefault | A logical value indicating whether the subsystem can perform default error recovery for the error condition. (继承自 Error。) | |
CanRetry | A logical value indicating whether the subsystem can retry the operation that caused the error condition. (继承自 Error。) | |
CanSubstitute | A logical value indicating whether a new result can be substituted for the operation that produced the error condition. (继承自 Error。) | |
Cargo | 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 (继承自 Error。) | |
Description | A string that describes the error condition. (继承自 Error。) | |
ErrorFlag |
一个逻辑值,表示是否刚刚发生了 SQL 错误。
| |
ErrorList | ||
ErrorMessage |
一个字符串,包含 SQL 错误消息。
| |
ErrorMessageLen |
一个数值,表示 SQL 错误消息的长度。
| |
FileHandle | A numeric value representing the file handle supplied to a function when an file error occurs. (继承自 Error。) | |
FileName | A string representing the name used to open the file associated with the error condition. (继承自 Error。) | |
FuncPtr | A pointer to the function in which the error occurred. (继承自 Error。) | |
FuncSym | A string representing the name of the function or method in which the error occurred. (继承自 Error。) | |
Gencode | An integer numeric value representing a Visual Objects generic error code. (继承自 Error。) | |
GenCodeText | An string containing the description of the Gencode. (继承自 Error。) | |
MaxSize | A numeric value representing a boundary condition for an operation (such as string overflow or array bound error). (继承自 Error。) | |
MethodSelf | An object representing the SELF of the method in which the error occurred. (继承自 Error。) | |
NativeError |
一个数值,表示本地 SQL 错误。
| |
Operation | A string that describes the operation being attempted when the error occurred. (继承自 Error。) | |
OSCode | A value of 0 indicates that the error condition was not caused by an error from the operating system. (继承自 Error。) | |
OSCodeText | Descripion of the OSCode (继承自 Error。) | |
ReturnCode |
一个数值,表示 SQL 返回代码值(例如,SQL_ERROR,SQL_SUCCESS_WITH_INFO 等)。
| |
Severity | A constant indicating the severity of the error condition. (继承自 Error。) | |
SQLState |
一个字符串,包含 SQL 错误状态(例如,S1000,这是一个一般错误)。
| |
Stack | Call stack from the moment where the error object was created (继承自 Error。) | |
StackTrace | (继承自 Error。) | |
SubCode | An integer numeric value representing a subsystem-specific error code. (继承自 Error。) | |
SubCodeText | An string containing the description of the SubCode. (继承自 Error。) | |
SubstituteType | A numeric value representing the type of the new result that the error handler substitutes for the operation that produced the error condition. (继承自 Error。) | |
SubSystem | A string representing the name of the subsystem generating the error. (继承自 Error。) | |
Tries | An integer numeric value representing the number of times the failed operation has been attempted. (继承自 Error。) |
名称 | 说明 | |
---|---|---|
SetStackTrace | (继承自 Error。) | |
ShowErrorMsg |
显示一个 SQL 错误消息。
| |
Throw | (重写 Throw.) | |
ToString | Creates and returns a string representation of the current exception. (继承自 Error。) |
名称 | 说明 | |
---|---|---|
GetInnerException | (由 Error 定义。) |
1LOCAL oSQLErrorInfo AS OBJECT 2LOCAL oConnection AS OBJECT 3LOCAL oSelect AS OBJECT 4// 创建SQLConnection对象 5oConnection := SQLConnection{"sample", "dba", "sql"} 6// 创建SQLSelect对象 7oSelect := SQLSelect{"SELECT * FROM lab", oConnection} 8// 测试无效参数 9IF SQLGetStmtOption(oSelect:StatementHandle, 30000, NULL_PTR) # SQLSuccess 10 // 现在,创建SQLErrorInfo对象以获取 11 // 最后一个错误。 前两个参数是 12 // 可选的,然后是环境句柄, 13 // 连接句柄,然后是 14 // SQLSelect的语句句柄。 15 oSQLErrorInfo := SQLErrorInfo{ , , ; 16 oConnection:EnvHandle,; 17 oConnection:ConnHandle,; 18 oSelect:StatementHandle} 19ENDIF 20 21?oSQLErrorInfo:ErrorFlag 22?oSQLErrorInfo:ErrorMessage 23?oSQLErrorInfo:NativeError 24?oSQLErrorInfo:SQLState