Executing Queries
Copy
The query can be executed at any time by right-clicking on the Query structure or by selecting the option from the Actions menu.
Executing the query from the top-level element or from the Actions menu executes the entire query structure. However, executing the query from one of the child elements returns the results for that substructure only.
Running the Start Execution command results in a window that looks similar to the following:
Figure 36.
The window offers an opportunity to add conditions on top of the ones defined by the search, enter parameter values, and set Max Count. If Conditions and/or Parameters are unspecified the query is executed without any filtering via conditions or parameters. The Max Count is intended to limit the number of top-level items returned by the search. These settings are recommended during development because the number of elements returned by the query could potentially be very large.
When ready, press the Execute command to run the search.
The search for the Part Query defined in Section Developing Query Definitions would return a structure similar to the following:
<AML>
<Item type="Part">
<id keyed_name="part_7">82A0B82AAD1C43309075640D21117E90</id>
<modified_by_id keyed_name="Innovator Admin">30B991F927274FA3829655F50C99472E</modified_by_id>
<name>part_7</name>
<state>Preliminary</state>
<item_number>part_7</item_number>
<Relationships>
<Item type="Part CAD">
<sort_order>128</sort_order>
<Relationships>
<Item type="CAD">
<current_state keyed_name="Preliminary">A29C9720FF0D4950A140A90BEEA903DA</current_state>
<id keyed_name="cad_1">C94B5097E5894EDA8C39C310F735832B</id>
<name is_null="1" />
<item_number>cad_1</item_number>
</Item>
</Relationships>
</Item>
<Item type="Part Documents">
<sort_order>1</sort_order>
<Relationships>
<Item type="Document">
<id keyed_name="Doc_01">FFB47BECC6E64E8BBB8254F0A61E9EEC</id>
<name>User Guide</name>
<state>Preliminary</state>
<item_number>Doc_01</item_number>
</Item>
</Relationships>
</Item>
<Item type="Part Created By">
<id keyed_name="Super User">AD30A6D8D3B642F5A2AFED1A4B02BEFA</id>
<login_name>root</login_name>
<first_name>Super</first_name>
<last_name>User</last_name>
</Item>
<Item type="Simple MCO Part (related_id)">
<Relationships>
<Item type="Simple MCO">
<created_on>2019-03-21T15:59:26</created_on>
<id keyed_name="MCO-100001">A5DCE160DE28465A8ECDFF37CEA6B75C</id>
<state>New</state>
<item_number>MCO-100001</item_number>
</Item>
</Relationships>
</Item>
</Relationships>
</Item>
</AML>
Relationships, including created_by_id and Simple MCO.