company logo

DataSource :: databaseVersion - VERSION option

Databases can be stored with different versions. Versions are numbered consecutively in order to identify the version the database is referring to. Defining a version number allows running the database for an old version instead of the current one.

In order to open the database for a version which is not the current database version, the value must be set before opening the data source.

Usually, this value is set in the configuration or ini-file in the VERSION option for the data source definition.

Default: current version

VERSION=1

Return value:  Major version number ( int32  )

Major versions are defined on database level. database versions are numbered consecutively beginning with 0, when consistent versioning has been enabled.

Implementation overview

Implementation details

  1. Get database version from data source
    int32 DataSource  :: databaseVersion (  )

    The function returns the version value set in the data source. This might differ from the database version used for the database currently opened. In order to get the database version for the database opened, database().version() should be called.

  2. to list
  3. Set database version
    int32 DataSource  :: databaseVersion ( int32 iVersion )

    The function changes the value of the database version currently set in the data source, but not the version for the database handle currently opened.

    The value must be set before opening the data source. Setting the value afterwards, it will not have any effect until reopening the database.

    In order to open the current (last) database version, -1 (CURRENT_VERSION) has to be passed in iVersion.

    • iVersion - Major version number

      Major versions are defined on database level. database versions are numbered consecutively beginning with 0, when consistent versioning has been enabled.

  4. to list