Check whether the database view is compliant with the meta-model
After changes have been made to the class model, database views might require adaptations to the changes.
To check whether the database views are still valid, a mechanism is implemented in Alfabet Expand that recreates all database views in the database and displays error messages for errors that occurred during recreation.
- Open the Meta-Model tab in Alfabet Expand.
- Right-click the Database Views explorer node and select Recreate Database Views. All database views are recreated in the Alfabet database in the order of definition.
A database view can target another database view and these views must be executed after the targeted database views are executed. Change the sort order if execution issues occur.
- Click on each database view in the explorer to check whether errors occurred. Errors can be read from the following read only attributes of the database view configuration object:
- Created: Displays True if the database view has been created. Displays False if the database view has not been created. Database views with the attribute Created set to False need to be corrected.
- Last Error: Displays the error that occurred during database view creation.
If you have defined a high number of database views, you can avoid clicking each node in the explorer by creating a configured report based on a native SQL query that reads the information which database views were not created. The following native SQL query will return the name of all database views that require re-configuration:
- SELECT REFSTR, NAME
- FROM ALFA_DB_EXT
- WHERE ISCREATED = 'False'
You can then directly open the explorer nodes of the database views returned by the report to see the error message and correct the query of the database view accordingly.
Database views are recreated after each Update Meta-Model or Restore Database Archive action and need to be checked as described above afterwards. The recreation ensures that new database views added to the configuration via the Update Meta-Model or Restore Database Archive action are created and that database views that are not compatible with the changes to the meta-model applied via Meta-Model Update are removed.