Compatibility modes

368 views
Skip to first unread message

pr1

unread,
Sep 29, 2019, 6:09:22 AM9/29/19
to H2 Database
Hello,
could someone explain the compatibility modes in H2?
If you use the Oracle-db driver in H2, must you write you SQL statements using the Oracle-SQL syntax?
If that is not the case, how does H2 translate H2-SQL statements to Oracle-SQL statements?
Many thanks.
Cheers,
pr1



Evgenij Ryazanov

unread,
Sep 29, 2019, 6:45:38 AM9/29/19
to H2 Database
Hello.

On Sunday, 29 September 2019 18:09:22 UTC+8, pr1 wrote:
Hello,
could someone explain the compatibility modes in H2?
If you use the Oracle-db driver in H2, must you write you SQL statements using the Oracle-SQL syntax?

What exactly do you mean? If you use the H2 Console to connect to the Oracle, you work with Oracle and should use its syntax, H2 will not translate anything, and the database engine of H2 will not be used.

If you create a linked table from an Oracle database inside a H2 database it does not affect the syntax of H2 in any way.

If you use the Oracle compatibility mode of H2 database you don't need Oracle's driver, it is not used. The behavior of H2 in compatibility modes is different from regular mode as described in the documentation:
Some differences may stay undocumented.
The compatibility modes provide only very limited compatibility. H2 is not an emulator of other databases. You can try to use the compatibility mode in an application that were designed to work with Oracle, but usually you need to adjust its SQL queries anyway.

Compatibility modes are usually used for unit testing of applications that normally work with other databases.
Reply all
Reply to author
Forward
0 new messages