Codes d'état SQL
Dans de nombreux cas (par exemple lors d'une exécution sous ODBC 2.0), nous pouvons récupérer diverses informations gràce aux codes d'états SQL.
Le code d'état SQL est composé de cinq caractères, que nous pouvons diviser en deux parties de la manière suivante :
- La classe qui est représentée par les deux premiers caractères.
Exemples :- Classe 00 : Instruction correctement exécutée sans condition
- Classe 01 : Instruction correctement exécutée avec avertissement
- Classe 02 : L'instruction n’a traité aucune donnée
- Classe 03 : L'instruction a échoué à cause d’une erreur
- La sous classe qui est représentée par les trois derniers caractères.
# | Classe | Sous classe | Message | Info |
0 | 00 | 000 | Successful completion | Erreur 00000 |
1 | 01 | 000 | Warning | Erreur 01000 |
2 | 01 | 002 | - disconnect error | Erreur 01002 |
3 | 01 | 003 | - null value eliminated in set function | Erreur 01003 |
4 | 01 | 004 | - string data, right truncation | Erreur 01004 |
5 | 01 | 005 | - insufficient item descriptor areas | Erreur 01005 |
6 | 01 | 006 | - privilege not revoked | Erreur 01006 |
7 | 01 | 007 | - privilege not granted | Erreur 01007 |
8 | 01 | 008 | - implicit zero-bit padding | Erreur 01008 |
9 | 01 | S01 | - error in row | Erreur 01S01 |
10 | 01 | S02 | - option value changed | Erreur 01S02 |
11 | 01 | S05 | - cancel treated as close | Erreur 01S05 |
12 | 01 | S06 | - attempt to fetch before the result set returned the first rowset | Erreur 01S06 |
13 | 01 | S07 | - fractional truncation | Erreur 01S07 |
14 | 02 | 000 | No data | Erreur 02000 |
15 | 07 | 000 | Dynamic SQL error | Erreur 07000 |
16 | 07 | 001 | - using clause does not match dynamic parameter specifications | Erreur 07001 |
17 | 07 | 002 | - using clause does not match target specifications | Erreur 07002 |
18 | 07 | 003 | - cursor specification cannot be executed | Erreur 07003 |
19 | 07 | 004 | - using clause required for dynamic parameters | Erreur 07004 |
20 | 07 | 005 | - prepared statement is not a cursor specification | Erreur 07005 |
21 | 07 | 006 | - restricted data type attribute violation | Erreur 07006 |
22 | 07 | 007 | - using clause required for result fields | Erreur 07007 |
23 | 07 | 008 | - invalid descriptor count | Erreur 07008 |
24 | 07 | 009 | - invalid descriptor index | Erreur 07009 |
25 | 07 | 00F | - invalid DATETIME_INTERVAL_CODE | Erreur 0700F |
26 | 08 | 000 | Connection exception | Erreur 08000 |
27 | 08 | 001 | - client unable to establish connection | Erreur 08001 |
28 | 08 | 002 | - connection name in use | Erreur 08002 |
29 | 08 | 003 | - connection does not exist | Erreur 08003 |
30 | 08 | 004 | - server rejected the connection | Erreur 08004 |
31 | 08 | 006 | - connection failure | Erreur 08006 |
32 | 09 | 000 | Triggered action exception | Erreur 09000 |
33 | 0A | 000 | Feature not supported | Erreur 0A000 |
34 | 0B | 000 | Invalid transaction initiation | Erreur 0B000 |
35 | 0K | 000 | Resignal when handler not active | Erreur 0K000 |
36 | 0W | 000 | Prohibited statement encountered during trigger execution | Erreur 0W000 |
37 | 21 | 000 | Cardinality violation | Erreur 21000 |
38 | 21 | S01 | - insert value list does not match column list | Erreur 21S01 |
39 | 21 | S02 | - degree of derived table does not match column list | Erreur 21S02 |
40 | 22 | 000 | Data exception | Erreur 22000 |
41 | 22 | 001 | - string data, right truncation | Erreur 22001 |
42 | 22 | 002 | - null value, no indicator parameter | Erreur 22002 |
43 | 22 | 003 | - numeric value out of range | Erreur 22003 |
44 | 22 | 005 | - error in assignment | Erreur 22005 |
45 | 22 | 006 | - invalid interval format | Erreur 22006 |
46 | 22 | 007 | - invalid datetime format | Erreur 22007 |
47 | 22 | 008 | - datetime field overflow | Erreur 22008 |
48 | 22 | 011 | - substring error | Erreur 22011 |
49 | 22 | 012 | - division by zero | Erreur 22012 |
50 | 22 | 015 | - interval field overflow | Erreur 22015 |
51 | 22 | 018 | - invalid character value for cast | Erreur 22018 |
52 | 22 | 019 | - invalid escape character | Erreur 22019 |
53 | 22 | 023 | - invalid parameter value | Erreur 22023 |
54 | 22 | 024 | - unterminated C string | Erreur 22024 |
55 | 22 | 025 | - invalid escape sequence | Erreur 22025 |
56 | 22 | 026 | - string data, length mismatch | Erreur 22026 |
57 | 22 | 027 | - trim error | Erreur 22027 |
58 | 22 | 029 | - noncharacter in UCS string | Erreur 22029 |
59 | 23 | 000 | Integrity constraint violation | Erreur 23000 |
60 | 24 | 000 | Invalid cursor state | Erreur 24000 |
61 | 25 | 000 | Invalid transaction state | Erreur 25000 |
62 | 25 | S03 | - transaction is rolled back | Erreur 25S03 |
63 | 26 | 000 | Invalid SQL statement name | Erreur 26000 |
64 | 27 | 000 | Triggered data change violation | Erreur 27000 |
65 | 28 | 000 | Invalid authorization specification | Erreur 28000 |
66 | 2E | 000 | Invalid connection name | Erreur 2E000 |
67 | 2F | 000 | SQL routine exception | Erreur 2F000 |
68 | 2F | 003 | - prohibited SQL-statement attempted | Erreur 2F003 |
69 | 2F | 005 | - function executed no return statement | Erreur 2F005 |
70 | 33 | 000 | Invalid SQL descriptor name | Erreur 33000 |
71 | 34 | 000 | Invalid cursor name | Erreur 34000 |
72 | 35 | 000 | Invalid condition number | Erreur 35000 |
73 | 37 | 000 | Syntax error or access violation in PREPARE or EXECUTE IMMEDIATE * | Erreur 37000 |
74 | 3C | 000 | Ambiguous cursor name | Erreur 3C000 |
75 | 40 | 000 | - transaction rollback | Erreur 40000 |
76 | 40 | 001 | - serialization failure | Erreur 40001 |
77 | 42 | 000 | Syntax error or access rule violation | Erreur 42000 |
78 | 42 | S01 | - base table or view already exists | Erreur 42S01 |
79 | 42 | S02 | - base table or view not found | Erreur 42S02 |
80 | 42 | S11 | - index already exists | Erreur 42S11 |
81 | 42 | S21 | - column already exists | Erreur 42S21 |
82 | 42 | S22 | - column not found | Erreur 42S22 |
83 | 44 | 000 | WITH CHECK OPTION violation | Erreur 44000 |
84 | 45 | 000 | Unhandled user-defined exception | Erreur 45000 |
85 | HY | 000 | General error | Erreur HY000 |
86 | HY | 001 | - memory allocation error | Erreur HY001 |
87 | HY | 003 | - invalid application buffer type | Erreur HY003 |
88 | HY | 004 | - invalid SQL data type | Erreur HY004 |
89 | HY | 007 | - associated statement is not prepared | Erreur HY007 |
90 | HY | 008 | - operation canceled | Erreur HY008 |
91 | HY | 009 | - invalid use of null pointer | Erreur HY009 |
92 | HY | 010 | - function sequence error | Erreur HY010 |
93 | HY | 011 | - attribute cannot be set now | Erreur HY011 |
94 | HY | 012 | - invalid transaction operation code | Erreur HY012 |
95 | HY | 013 | - memory management error | Erreur HY013 |
96 | HY | 014 | - limit on the number of handles exceeded | Erreur HY014 |
97 | HY | 015 | - no cursor name available | Erreur HY015 |
98 | HY | 016 | - cannot modify an implementation row descriptor | Erreur HY016 |
99 | HY | 017 | - invalid use of an automatically allocated descriptor handle | Erreur HY017 |
100 | HY | 018 | - server declined cancel request SQLCancel | Erreur HY018 |
101 | HY | 019 | - non-character and non-binary data sent in pieces | Erreur HY019 |
102 | HY | 020 | - attempt to concatenate a null value | Erreur HY020 |
103 | HY | 021 | - inconsistent descriptor information | Erreur HY021 |
104 | HY | 024 | - invalid attribute value | Erreur HY024 |
105 | HY | 090 | - invalid string or buffer length | Erreur HY090 |
106 | HY | 091 | - invalid descriptor field identifier | Erreur HY091 |
107 | HY | 092 | - invalid attribute/option identifier | Erreur HY092 |
108 | HY | 093 | - invalid parameter number | Erreur HY093 |
109 | HY | 095 | - function type out of range | Erreur HY095 |
110 | HY | 096 | - invalid information type | Erreur HY096 |
111 | HY | 097 | - column type out of range | Erreur HY097 |
112 | HY | 098 | - scope type out of range | Erreur HY098 |
113 | HY | 099 | - nullable type out of range | Erreur HY099 |
114 | HY | 100 | - uniqueness option type out of range | Erreur HY100 |
115 | HY | 101 | - accuracy option type out of range | Erreur HY101 |
116 | HY | 102 | - table type out of range | Erreur HY102 |
117 | HY | 103 | - invalid retrieval code | Erreur HY103 |
118 | HY | 104 | - invalid precision or scale value | Erreur HY104 |
119 | HY | 105 | - invalid parameter type | Erreur HY105 |
120 | HY | 106 | - fetch type out of range | Erreur HY106 |
121 | HY | 107 | - row value out of range | Erreur HY107 |
122 | HY | 108 | - concurrency option out of range | Erreur HY108 |
123 | HY | 109 | - invalid cursor position | Erreur HY109 |
124 | HY | 110 | - invalid driver completion | Erreur HY110 |
125 | HY | 111 | - invalid bookmark value | Erreur HY111 |
126 | HY | C00 | - optional feature not implemented | Erreur HYC00 |
127 | HY | T00 | - timeout expired | Erreur HYT00 |
128 | HY | T01 | - connection timeout expired | Erreur HYT01 |
129 | IM | 000 | ODBC specific return codes | Erreur IM000 |
130 | IM | 001 | - driver does not support this function | Erreur IM001 |
131 | IM | 008 | - dialog failed | Erreur IM008 |
132 | S0 | 000 | ODBC 2.0 codes * | Erreur S0000 |
133 | S0 | 001 | - base table or view already exists * | Erreur S0001 |
134 | S0 | 002 | - base table not found * | Erreur S0002 |
135 | S0 | 011 | - index already exists * | Erreur S0011 |
136 | S0 | 012 | - index not found * | Erreur S0012 |
137 | S0 | 021 | - column already exists * | Erreur S0021 |
138 | S0 | 022 | - column not found * | Erreur S0022 |
139 | S1 | 000 | General error | Erreur S1000 |
140 | S1 | 001 | - memory allocation failure | Erreur S1001 |
141 | S1 | 002 | - invalid column number | Erreur S1002 |
142 | S1 | 003 | - program type out of range | Erreur S1003 |
143 | S1 | 004 | - SQL data type out of range | Erreur S1004 |
144 | S1 | 008 | - operation canceled | Erreur S1008 |
145 | S1 | 009 | - invalid argument value | Erreur S1009 |
146 | S1 | 010 | - function sequence error | Erreur S1010 |
147 | S1 | 012 | - invalid transaction operation code specified | Erreur S1012 |
148 | S1 | 090 | - invalid string or buffer length | Erreur S1090 |
149 | S1 | 091 | - descriptor type out of range | Erreur S1091 |
150 | S1 | 092 | - option type out of range | Erreur S1092 |
151 | S1 | 093 | - invalid parameter number | Erreur S1093 |
152 | S1 | 095 | - function type out of range | Erreur S1095 |
153 | S1 | 096 | - information type out of range | Erreur S1096 |
154 | S1 | 097 | - column type out of range | Erreur S1097 |
155 | S1 | 098 | - scope type out of range | Erreur S1098 |
156 | S1 | 099 | - nullable type out of range | Erreur S1099 |
157 | S1 | 100 | - uniqueness option out of range | Erreur S1100 |
158 | S1 | 101 | - accuracy option type out of range | Erreur S1101 |
159 | S1 | 102 | - table type out of range | Erreur S1102 |
160 | S1 | 105 | - direction option out of range | Erreur S1105 |
161 | S1 | 106 | - fetch type out of range | Erreur S1106 |
162 | S1 | 107 | - row value out of range | Erreur S1107 |
163 | S1 | 108 | - concurrency option out of range | Erreur S1108 |
164 | S1 | 109 | - invalid cursor position | Erreur S1109 |
165 | S1 | C00 | - driver not capable | Erreur S1C00 |
166 | S1 | T00 | - timeout expired | Erreur S1T00 |
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 06/07/2005, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/sql-states.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.