%DatabaseRelease meta-SQL element
Syntax
%DatabaseRelease([descr_level])
Description
The %DatabaseRelease meta-SQL variable returns the database version of the current database connection. The return value is a number or a string depending on descr_level. Optionally specify the description level as MAJOR, FULL, or DESCR.
If MAJOR is specified, %DatabaseRelease returns the major release number as a number value.
If FULL is specified, %DatabaseRelease returns the full release and version as a string value.
If DESCR is specified, %DatabaseRelease returns the full release and version with description as a string value.
Parameters
| Parameter | Description |
|---|---|
|
descr_level |
Specify the level of description to be returned. Valid values are MAJOR, FULL, and DESCR. This parameter is optional. The default is MAJOR. |
Example
If the current database is Oracle Database 10g Enterprise Edition Release 10.2.0.3.0- 64-bit Production With the Partitioning and Data Mining option:
SQLExec("SELECT %DatabaseRelease(MAJOR) from %SelectDummyTable", &DBRel);
Returns 10.
SQLExec("SELECT %DatabaseRelease(FULL) from %SelectDummyTable", &DBRel);
Returns '10.2.0.3.0',
SQLExec("SELECT %DatabaseRelease(DESCR) from %SelectDummyTable", &DBRel);
Returns 'Oracle Database 10g Enterprise
Edition Release 10.2.0.3.0- 64bit Production With the Partitioning
and Data Mining options'.