Defines how queried data is handled once passed into FOX.
<fm:run-query interface=”dbinterface” query=”query” match="XPath" mode=”string”/>
The fm:query mode attribute (overridden by fm:run-query) specifies how to process rows:
The PURGE-SELECTED and AUGMENT modes require Row/DOM synchronisation:
To synchronise Row/DOM a result record Primary Key (PK) is required:
Which mode you use is application specific and depends on what DOM data you can afford to lose:
<fm:run-query name="qry-add-to" mode="ADD-TO">
<fm:query name="qry-add-to" mode="ADD-TO">
<fm:target-path match="PRODUCT"/>
<fm:select>
SELECT *
FROM envmgr.product
WHERE product_nr IN (1001, 1003, 1005)
</fm:select>
</fm:query>
<fm:run-query name="qry-augment" mode="AUGMENT">
<fm:query name="qry-augment">
<fm:target-path match="PRODUCT"/>
<fm:primary>
<fm:key>PRODUCT_NR</fm:key>
</fm:primary>
<fm:select>
SELECT product_nr, (sale_price - cost_price) Profit
FROM envmgr.product
</fm:select>
</fm:query>
<fm:query name="qry-purge-all" mode="PURGE-ALL">
<fm:query name="qry-purge-all" mode="PURGE-ALL">
<fm:target-path match="PRODUCT"/>
<fm:select>
SELECT product_nr, (sale_price - cost_price) Profit
FROM envmgr.product
</fm:select>
</fm:query>
<fm:query name="qry-purge-selected" mode="PURGE-SELECTED">
<fm:query name="qry-purge-selected">
<fm:target-path match="PRODUCT"/>
<fm:primary>
<fm:key>PRODUCT_NR</fm:key>
</fm:primary>
<fm:select>
SELECT product_nr, (sale_price - cost_price) Profit
FROM envmgr.product
WHERE product_nr IN (1001, 1003, 1005)
</fm:select>
</fm:query>
Please use your XX_EMPLOYEEMODULE (where XX are your initials) file for the following exercises.
Create a query named “qry-userAccount3” that will select the ID, Forename, Surname and Hire_date from scott.employee_search where ID is less than 2,300. Create 4 different buttons named “action-add-to”, “action-augment”, “action-purge-all” and “action-purge-selected” which will run the query with their respective modes. Create a new namespace named “qry-modes” to set-out the actions and create a menu out to display the buttons in the order listed above.
This data should populate the structure /*/EMPLOYEE_LIST/EMPLOYEE in the Theme DOM.