SQLSTATE: Difference between revisions

Content deleted Content added
No edit summary
Kelti (talk | contribs)
m Wording
Line 1:
{{More citations needed|date=December 2024}}
 
Programs calling a database whichthat accords to the [[SQL]] standard receive an indication aboutof 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 whichthat 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 <code>GET DIAGNOSTICS</code> 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.