How to determine the current Version of your AE-Database schema.
The information about the current schema version of the AE database is distributed into 2 tables. UC_VERSI and VERSION.
With each Database-Version an additional row containing the major and minor revision is appended to UC_VERSI.
With each Database-Version and DB-Step the table VERSION is dropped an recreated. The only column in the table VERSION carries the name of the DB-Step.
SQL-Statements to retrieve the current DB-Version and DB-Step:
select top 1 VERSI_Major, VERSI_Minor, COLUMN_NAME as DB_Step from UC_VERSI, INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'VERSION' order by VERSI_Major desc, VERSI_Minor desc;
select * from( select VERSI_Major, VERSI_Minor, COLUMN_NAME DB_Step from UC_VERSI, USER_TAB_COLUMNS where table_name = 'VERSION' order by VERSI_Major desc, VERSI_Minor desc) where ROWNUM < 2;
DB2 (has to be adapted to match the database name):
select VERSI_Major, VERSI_Minor, NAME as DB_Step from UC_VERSI, SYSIBM.SYSCOLUMNS where TBNAME = 'VERSION' and TBCREATOR='your db schema owner here' order by VERSI_Major desc, VERSI_Minor desc fetch first 1 rows only;