GR:Gravity/Xref/Queries/Query Definitions

From Remain Software
< GR:Gravity‎ | Xref‎ | Queries
Revision as of 14:42, 11 September 2020 by Wim (talk | contribs) (Created page with "=== Xref Query Definition === As an extension to the Xref Query functionality, an Xref definition is a query template that can contain 1 or more placeholders, represented by t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Xref Query Definition

As an extension to the Xref Query functionality, an Xref definition is a query template that can contain 1 or more placeholders, represented by the value '<#>', for runtime variable substitution. This construct allows a user, for example, to select a component from the TD/OMS components view and have it run against an Xref Query definition. In essence, the Xref definition describes the search query, query attributes, and which groups/locations are to be used in the query. The Xref query definition menus (Create, Update, Delete) can be accessed from the top toolbar 'Xref' menu:


Xref query def menus 2.png

Create an Xref Query Definition

Xref query create 2.png

In the example above a very simple query definition, with the name 'find_table_def_pfile', is created that will do a full search of the runtime provided substitute value '<#>'. This query definition can for example be used from the TD/OMS components view to locate a physical file used in an RPG PFILE keyword.

You can use a previously run query to pre-fill the dialog fields, the fields filled will match the terms and locations used in the loaded query. Using the history to load a query is very useful as you can test a definition with the Advanced Query dialog before creating it.

A query definition can contain 1 or more placeholders for variable substitution, it is up to the code logic applying the definition to replace the placeholders with actual data to be used for a search.

Update an Xref Query Definition

Xref query update 2.png

Select the definition to be updated from the 'Query Definition' drop-down menu, update the fields you need to change (you can also rename the query), and press finish.

Delete an Xref Query Definition

Xref query delete 2.png

Select the definition to be deleted from the 'Query Definition' drop-down menu and press finish.


The use of Xref query definitions depends on the use of them by logic implemented in Gravity or TD/OMS. Currently, TD/OMS can utilize an Xref query definition when a component is selected in the components view. If a query definition exists then it will be available from the pop-up menu of the component. For example from the TD/OMS components view:

Xref query def comp view.png

In the example above the component OMAPP was used as input for the query definition 'find_table_def_pfile' which in our setup yielded a single hit:

Xref query def comp view result.png