Database view is the result set of a query on the data stored in database table(s). Unlike ordinary base tables in a relational database, a view is a virtual table computed or collated dynamically from data in the database when access to that view is requested. Changes applied to the data in a relevant underlying table are reflected in the data shown in subsequent invocations of the view.
Views can provide advantages over tables:
Views take very little space to store; the database contains only the definition of a view, not a copy of all the data that it presents.
You can manipulate nested views, since one view can aggregate data from other views.
The rows of a view are not ordered. View is a relational table, and therefore represents just a set of rows. ORDER BY condition in the view definition is meaningless. However, you can obtain sorted data from a view, just as you do with any other table — as part of a query statement on that view.
AnyLogic provides users with a set of pre-defined database views, logs collected during the model execution.
You can also create your own database view based on your own database tables, or raw data tables.
To create a new database view
Name
– The name of the database view.
I do not need this type of log
– [Visible if this view is an AnyLogic
log] If selected, the data for this log is not collected.
Create an editable copy of this view – [Visible if this view is an AnyLogic log] Click this label to create a copy of this uneditable view and modify it according to your needs (by editing the SQL query in the View definition field).
View definition – [Visible if the DB view is user-created] SQL query that produces this view. You can edit this query to modify the view.
Columns – [Visible if the DB view is user-created] The non-editable list of view columns (it is formed by the view's SQL query). You can see the Column name and Type for each column of this view.