Edit database queries
You do not have to select a node to edit database queries using this dialog. You can create new expressions or delete and edit existing expressions.
To select a database query
- In the Edit menu, select the Edit database query item.
- On the left-hand side of the Edit database queries dialog, mark a database query list.
- Perform one of the following tasks:
- Overwrite the database expression name in the Identifier.
- Enter explanatory text in Description.
- Edit the SQL expression.
- Select or de-select other dialog groups.
- Select or de-select all dialog groups.
- Test the expression by clicking on Test statement... and enter a parameter value in the next dialog.
- Save the changes.
Loading a historical object state
You can reset the state of a database object in a collection if you have enable recording of historical data in the database.
To reset a database object to a previous state
- Add a database collection.
For more information, see "Database objects" as a collection.
- Add the Load objects including history action to an action node.
- At this node, select the collect.
- Choose between two options:
- Select Load objects including history to load historical object statuses for an individual object.
Here you can enter an object key (XObjectKey) that uniquely identifies the object.
- Select Load table with history to load historical table data.
You can enter a column name and its value as restriction criteria.
NOTE: Once historical object states are loaded as described, you can simply set the collection to any point in time within the loaded time period.
- Add the action Set object to historical state on the action node.
- Select the collection.
- Enter the date under Date.
The collection is set to the state that was current at that time.
Loading a change history
A change history contain a list of all operations recorded on a defined amount of data. You can load a change history into a special collection type designed for the purpose.
To define a collection for a change history
- Open the module or component to which to add the collection.
- Select the Collections node by right-clicking on it.
- Select the Change history option.
- Enter the name for the new collection in Identifier.
- In the Type field, select the type of change history.
To load a change history
- Right-click to select an action node.
- Select the Load change history action.
- Under Collection, select a collection.
- In the Type field, select the type of change history defined for the collection.
NOTE: The setting in Type must be identical for the collection and the change history to be loaded.
- Enter the date up to which you want to load the change history in Load historical data back to (date).
- Select one of the following scenarios to continue:
- To load the change history of an individual object, enter the Web SQL expression of the (XObjectKey) object key of the required object.
- Enter the relevant table name to load the change history for a table or an assignment object.
NOTE: Optionally, you can specify the column name and the value for a filter condition.
A collection layer view behaves in the same way as a database layer view. The content of the view is defined with a Web SQL expression. The view is updated during runtime. The view is automatically updated if the source data changes.
To add a view
Select the Collections node by right-clicking on them.
Select the Add collection data view action.
In the Identifier field, enter your name for the new collection.
In the View expression field, enter the Web SQL expression for representing the view content.
NOTE: Add a property with the matching data type for every view property in Web Designer.