Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find which compatibility mode an H2 database is in?

Tags:

h2

I know I can set a compatibility mode via SQL in H2, eg.

SET MODE ORACLE

Is there corresponding SQL to query which mode the database is currently in?

like image 500
Julia Hayward Avatar asked Nov 23 '25 08:11

Julia Hayward


1 Answers

You can do:

For new version of INFORMATION_SCHEMA.SETTINGS for H2 2.0 and above:

SELECT SETTING_VALUE FROM INFORMATION_SCHEMA.SETTINGS WHERE SETTING_NAME = 'MODE';

Legacy version of INFORMATION_SCHEMA for H2 1.4.200 and below:

SELECT VALUE FROM INFORMATION_SCHEMA.SETTINGS WHERE NAME = 'MODE';

Then make a case insensitive comparison to the different modes.

like image 123
Oleg Avatar answered Nov 28 '25 16:11

Oleg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!