The description file contains a great deal of information used to work with versions.
[Database] section
The Database section contains details of the expected (current) version of the application database, and on the method used to determine the version of an existing database.
Parameter |
Description |
version |
Version of the database to which the file refers. Information used to control database coherence when utilities start running and for the automatic update procedure. |
checkversion |
SQL query used to read the version number of an existing database. With a Btrieve database, version management is made via the creation of a 'Version.ini' file in the Btrieve file directory. |
vendordll |
User DLL allowing a precise control of version management. * replaces the query specified via 'CheckVersion' |
There are two ways to determine the version of a database:
By using an SQL query on a dedicated table (checkversion) to read it directly in the database *
Example: select max (version) from sysadel.dbversion
By using a service provided by a user DLL (vendordll).
* or in the 'version.ini' file with Btrieve databases.
[PDM/*] and [Data/*] sections
These sections contain the descriptions of the script sequences to run when updating a database.
Scripts are sequenced as shown below:
do_while base_version < current_version
if find_execute_pdm_script (base_version, intermediate_version) = error
exit (error)
end
if find_execute_data_script (base_version) = error
exit (error)
end
base_version = intermediate_version
redo
The system will first look for a script sequence in the specific section for the DBMS being used [PDM/<DBMS>] or [Data/<DBMS>], then in the generic section [PDM/Generic] or [Data/Generic].
The absence of a reference to a file in the sequence results in a sequence error. It is, however, possible not to provide a table description or data insertion file at a given step, by naming the file "*no_file".
Example: a description file containing the necessary information to enable the migration of a database from version 1.0 to version 2.0, with an exception for the Oracle manager.
[Database] AppName=Sample Version=2.0 Comment=A sample application for demonstration purpose - v2 VendorDLL=samdll.dll
[Oracle] UserUtil=SAMPLE PasswordUtil=SAMPLE
[PDM/Generic] *ALL=sample.gen
1.0 = 2.0, sample_10_20.gen
[DATA/Generic] *ALL=sample.dat
1.0 = sample_10_20.dat
[DATA/Oracle] 1.0 = sample_10_20_oracle.dat
[EXPORT] SAMPLE.SAMPLE_DATA = SAMPLE_DATA.IXF SAMPLE.SAMPLE_VERS = SAMPLE_VERS.IXF
|