|
For a general introduction to queries see What are queries? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The KB can be used to store queries and query menus. The query menus will automatically be included in the menu-bar in PRO3.EXE (you have to exit and re-enter PRO3.EXE for this to happen). The purpose is to provide a simple of way running often-used queries. Pro/3 has a standard set of queries covering queries relating to terminology, sentence model and knowledge dependencies. These queries and query menus can be loaded from PRO3-x-Q1.3PR. Queries and query menus are represented as sentences in the KB. Three sentence types are involved:
Generally queries and query menus form a hierarchical structure with a system-defined root-menu with menu-ID 7000 (corresponding to the menu entry Query in the MDI-windows menu toolbar). First-level sub-menus and queries have menu 7000 as owner. You can define several layers of sub-menus of you so wish. Menu-IDs and query IDs are limited to the range 8001-8999. Pro/3 standard menus and queries use IDs in the 7001-7999 range. To avoid referential integrity warnings you must enter sub-menus before you enter queries under these menus, and similarly you must enter query parameters before you enter queries that use them. Query clusters must be entered after all the queries in the cluster has been entered. Queries belong to a menu, so you will have to define at least one query menu before you attempt to store queries in the KB. Query parameters are optional. The user will be prompted for actual values of the parameters when the query is run. A predefined set of alternative parameter values can optionally be defined. The query menu entity type:
The KB- query entity type:
Notes!
Parameters can optionally be embedded in a query. The user will be prompted for the desired actual parameter value each time the query is run. Embedding is done by including the parameter name in curly brackets:
The query parameter entity type:
Note that PR-format queries require actual parameters (and alternatives if specified) in PR-format, while NL-format queries correspondingly require actual parameters in NL-format. For this reason, it is generally a good idea to define queries with parameters in NL-format. You can also create a cluster of queries which are executed together. The user will be prompted for actual parameter entry only once if the queries share parameters. A query cluster is entered as a query, however the query text data element is used to specify the queries in the cluster. The queries are identified by their menu-ID and separated by semicolon.
The user will be prompted for the desired actual parameter value each time a parameterized query is run. There is one dialog for parameters where no value alternatives are defined, and one for parameters with defined value alternatives:
|