SQLSTATE: Difference between revisions

Content deleted Content added
GreenC bot (talk | contribs)
Add {{Unreferenced}} (via noref bot)
Kelti (talk | contribs)
Citation added
Line 1:
Programs calling a database which accords to the [[SQL]] standard receive an indication about the success or failure of the call. This return code - which is called SQLSTATE - consists of 5 byte. They are divided into two parts: the first and second byte contains 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).
{{Unreferenced|date=June 2019|bot=noref (GreenC bot)}}
Programs calling a database which accords to the SQL standard receive an indication about the success or failure of the call. This return code - which is called SQLSTATE - consists of 5 byte. They are divided into two parts: the first and second byte contains 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 DBMS are free to define additional values for SQLSTATE to handle those features which are beyond the standard. Such values must use one of the characters [I-Z] or [5-9] as the first byte of class (1. byte of SQLSTATE) or subclass (3. byte of SQLSTATE).
Line 6 ⟶ 5:
* 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]]<ref name="Whitemarsh" />. The table's last column shows that part of the standard, which defines the row. If it is empty, the definition origins from part 2 ''Foundation''.
 
{|class="wikitable"
Line 619 ⟶ 618:
|}
 
==References==
{{reflist|30em|refs=
<ref name="Whitemarsh">{{ cite journal | url = http://www.wiscorp.com/sql200n.zip | format = Zip | title = SQL:2008 draft | publisher = Whitemarsh Information Systems Corporation }}</ref>
}}
 
[[Category:SQL| ]]