encyclopegia.org

SQLSTATE

Programs calling a database that conforms to the SQL standard receive an indication of the success or failure of the call. This return code - which is called SQLSTATE - consists of 5 bytes. They are divided into two parts: the first and second bytes contain a class and the following three a subclass. Each class belongs to one of four categories: "S" denotes "Success" (class 00), "W" denotes "Warning" (class 01), "N" denotes "No data" (class 02), and "X" denotes "Exception" (all other classes). * Real DBMSs are free to define additional values for SQLSTATE to handle those features that are beyond the standard. Such values must use one of the characters [I-Z] or [5-9] as the first byte of class (first byte of SQLSTATE) or subclass (third byte of SQLSTATE). * In addition to SQLSTATE, the SQL command GET DIAGNOSTICS offers more details about the last executed SQL command. * In very early versions of the SQL standard, the return code was called SQLCODE and used a different coding schema. The following table lists the standard-conforming values - based on SQL:2011. The table's last column shows the part of the standard that defines the row. If it is empty, the definition originates from part 2 Foundation.

Programs calling a database that conforms to the SQL standard receive an indication of the success or failure of the call. This return code - which is called SQLSTATE - consists of 5 bytes. They are divided into two parts: the first and second bytes contain a class and the following three a subclass. Each class belongs to one of four categories: "S" denotes "Success" (class 00), "W" denotes "Warning" (class 01), "N" denotes "No data" (class 02), and "X" denotes "Exception" (all other classes). Real DBMSs are free to define additional values for SQLSTATE to handle those features that are beyond the standard. Such values must use one of the characters [I-Z] or [5-9] as the first byte of class (first byte of SQLSTATE) or subclass (third byte of SQLSTATE). In addition to SQLSTATE, the SQL command GET DIAGNOSTICS offers more details about the last executed SQL command. In very early versions of the SQL standard, the return code was called SQLCODE and used a different coding schema. The following table lists the standard-conforming values - based on SQL:2011. The table's last column shows the part of the standard that defines the row. If it is empty, the definition originates from part 2 Foundation. ==References==

References

No reference rows published for this article.

Cite this article

MLA

"SQLSTATE." encyclopegia.org, 2026, https://encyclopegia.org/wiki/sqlstate. Accessed 24 November 2026.

Chicago

"SQLSTATE." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/sqlstate.

APA

encyclopegia.org. (2026). SQLSTATE. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/sqlstate

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

NEVER Openweight 6-Man Tag Team Championship

enwiki · references available

Gorev

enwiki · references available

Issam Al-Qarni

enwiki · references available

Ross Smith (rugby union)

enwiki · references available

Hari Shankar Vyas

enwiki · references available

Rosedale, Defiance County, Ohio

enwiki · references available

Ameen Khosravian

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1371078517 · 0.5 · snapshot enwiki-001371078517

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.