Tuesday, June 7, 2022
HomeProgrammingHow one can Get an RDBMS Server Model with SQL – Java,...

How one can Get an RDBMS Server Model with SQL – Java, SQL and jOOQ.


Do it is advisable know what RDBMS Server model you’re on, and also you solely have SQL at your disposal? No downside. Most RDBMS offer you that data in some type of meta information desk.

Right here’s how:

-- CockroachDB
choose model();

-- Db2
choose service_level from desk (sysproc.env_get_inst_info()) t

-- Derby
choose getdatabaseproductversion() from (values (1)) t (a);

-- Exasol
choose param_value 
from exa_metadata 
the place param_name="databaseProductVersion";

-- Firebird
choose rdb$get_context('SYSTEM', 'ENGINE_VERSION')
from rdb$database;

-- H2
choose h2version(); 

-- HANA
choose * from m_database;

-- HSQLDB
choose character_value
from information_schema.sql_implementation_info
the place implementation_info_name="DBMS VERSION"

-- Informix
choose dbinfo('model', 'full') from systables the place tabid = 1;

-- MariaDB
choose model();

-- MemSQL (SingleStore)
choose model();

-- MySQL
choose model();

-- Oracle
choose * from v$model;

-- PostgreSQL
choose model();

-- Snowflake
choose current_version();

-- SQL Server
choose @@model;

-- SQLite
choose sqlite_version();

-- Teradata
choose infodata from dbc.dbcinfov the place infokey = 'VERSION'

Lacking this information in your personal RDBMS? Be at liberty to remark.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments