## Tcl9.0.3/Tk9.0.3 Documentation > TDBC Package Commands, version 1.1.13 > tdbc_mapSqlState

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

### NAME

tdbc::mapSqlState — 不都合階級にSQL状態を対応する 　　　Map SQLSTATE to error class

### SYNOPSIS

package require tdbc 1.0
tdbc::mapSqlState sqlstate

### 説明 DESCRIPTION

tdbc::mapSqlState 命令は､不都合が生じた時､ SQL 基礎データから返されたとして､五文字の 'SQL state' であることが予想される文字列を受入れる｡ そして､文字列の最初の二文字列を調べて､人間可読と機械可読の名前として不都合の階級を返す(譬えば､FEATURE_NOT_SUPPORTED や DATA_EXCEPTION や INVALID_CURSOR_STATE)｡　　　　　　 The tdbc::mapSqlState command accepts a string that is expected to be a five-character 'SQL state' as returned from a SQL database when an error occurs. It examines the first two characters of the string, and returns an error class as a human- and machine-readable name (for example, FEATURE_NOT_SUPPORTED, DATA_EXCEPTION or INVALID_CURSOR_STATE).

TDBC の規格は基礎データ駆動譜に不都合が生じた時には､不都合符号の形式で不都合の記述を返すことを要求している｡ その記述は文字列であって 少なくとも四つの要素を有する､即ち: "TDBC errorClass､ sql 状態､ 駆動譜名称､詳細 ..."｡ tdbc::mapSqlState 命令は､基礎データから返される SQL 状態から不都合級要素を生成するための便利な方法を TDBC 駆動譜に 与える｡ 　　　　　　　　　　　　　　　　 The TDBC specification requires database drivers to return a description of an error in the error code when an error occurs. The description is a string that has at least four elements: "TDBC errorClass sqlstate driverName details...". The tdbc::mapSqlState command gives a convenient way for a TDBC driver to generate the errorClass element given the SQL state returned from a database.

### SEE ALSO

tdbc, tdbc::tokenize, tdbc::connection, tdbc::statement, tdbc::resultset

### KEYWORDS

TDBC, SQL, database, state

### COPYRIGHT

Copyright (c) 2009 by Kevin B. Kenny.
Copyright © 2009 by Kevin B. Kenny.