You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INFORMATION_SCHEMA in H2 is now compliant with the SQL Standard and other database systems,
150
+
but it isn't compliant with previous versions of H2.
151
+
You may need to update your queries.
70
152
</p>
71
153
72
154
<h2id="general">General</h2>
73
155
74
156
<p>
75
157
There are a lot more SQL keywords now. Many SQL statements feature far better support of SQL-Standard behaviour.
76
-
Some old non-standard SQL syntax support has been removed.
158
+
There is a <ahref="https://h2database.com/html/commands.html#set_non_keywords">NON_KEYWORDS</a> setting that
159
+
can be used as a temporary workaround if your application uses them as unquoted identifiers.
160
+
</p>
161
+
162
+
<p>
163
+
Numeric and boolean values aren't comparable. It means you need to use TRUE, FALSE, or UNKNOWN (NULL)
164
+
as boolean literals. 1 and 0 don't work any more (with exception for some compatibility modes).
165
+
</p>
166
+
167
+
<p>
168
+
Some other non-standard SQL syntax has been restricted to related compatibility modes.
169
+
Since H2 2.0.204 there is a LEGACY compatibility mode that provides some limited compatibility with previous versions.
170
+
</p>
171
+
172
+
<p>
173
+
Various deprecated grammar elements are marked in red in documentation. Please, avoid their usage.
77
174
</p>
78
175
79
176
<p>
80
177
Migrating an old database to the new version works most of the times. However, there are a couple of important changes in the new version to keep in mind:
81
178
</p>
82
179
83
180
<ul>
84
-
<li>Restricted maximum allowed length limits: there are new length limits for for non-LOB data types. For example, for the VARBINARY type the maximum allowed size is now 1048576 instead of the previous 2^31-1. Adjust the tables before migration.
85
-
</li><li>Oracle-style units were never supported officially without being in Oracle compatibility mode, although some worked before. For example, the length of the VARCHAR datatype cannot be more specified using CHAR but CHARACTERS or OCTETS. CHAR and BYTE need to be used in Oracle compatibility mode.
181
+
<li>Oracle-style units were never supported officially without being in Oracle compatibility mode, although some worked before. For example, the length of the VARCHAR datatype cannot be more specified using CHAR but CHARACTERS or OCTETS. CHAR and BYTE need to be used in Oracle compatibility mode.
86
182
</li><li>IDENTITY syntax changed when type is specified: if the type for IDENTITY is specified, then the clause needs to be expanded as INTEGER GENERATED ALWAYS AS IDENTITY. Using just INTEGER IDENTITY is no more working.
87
-
</li><li>IDENTITY() and SCOPE_IDENTITY() functions are removed: statements like CALL IDENTITY(); aren't working anymore. Use data change delta tables or Statement.getGeneratedKeys() instead.
88
183
</li><li>LOG connection setting removed: PageStore was removed from H2 so the "LOG=0" setting at the end of the URL (like
89
184
"jdbc:h2:file:/tmp/test;LOG=0") is no longer available.
0 commit comments