<<<<<<< HEAD h2version | H2 | SQLDoc
Skip to main content

h2version

1. H2VERSION Function​

======= h2version | H2 Function | SQLDoc

h2version

1. H2VERSION Function​

>>>>>>> 9d19b1c8cb744c8e86d5c15b74d8b5f719ad62be

The H2VERSION function in H2 database is used to retrieve the version information of the H2 database software.

2. Syntax​

The syntax for the H2VERSION function in H2 database is as follows:

H2VERSION()

Arguments​

  • This function does not require any arguments.

Return​

  • The H2VERSION function returns a string representing the version of the H2 database software.

3. Notes​

  • The H2VERSION function is a built-in function in H2 database, so it does not require any additional setup or configuration.
  • The returned version string includes information such as the major version, minor version, and build number of the H2 database software.
  • This function can be useful to quickly check the version of the H2 database being used, especially when dealing with multiple database instances.

4. Examples​

Here are a few examples demonstrating the usage of the H2VERSION function in H2 database:

Example 1 - Retrieving the H2 database version:​

SELECT H2VERSION() AS version;

Output:

version
-----------
1.4.200 (2019-10-14)

Example 2 - Using the version information in a query:​

SELECT 'Running H2 version ' || H2VERSION() AS message;

Output:

message
----------------------
Running H2 version 1.4.200 (2019-10-14)

There are no related functions specific to the H2VERSION function in H2 database. However, you may find the following functions useful for general database management:

  • DATABASE() - Retrieve the current database name.
  • CURRENT_TIMESTAMP() - Retrieve the current timestamp.
  • CURRENT_USER() - Retrieve the current user name.