fm:query is used to define the query data transformation rules
<fm:db-interface name="dbint-dual">
<fm:query name="qry-sysdate">
<fm:select>
SELECT student_name
FROM scott.students
WHERE student_id = :1
</fm:select>
<fm:using name=”:1”>/ROOT/STUDENT/ID</fm:using>
</fm:query>
</fm:db-interface>
e.g. if using names, it does not matter which order you put them in when listing each <fm:using name=”name”>Xpath</fm:using>, however, if you use :3 for example in the query as a bind variable, you will have to make sure the third <fm:using>Xpath</fm:using> you make actually points to the element you require for that particular bind variable.
Query sysdate into the current attach point:
<fm:db-interface name="dbint-dual">
<fm:query name="qry-sysdate">
<fm:select>
SELECT sysdate
FROM dual
</fm:select>
</fm:query>
</fm:db-interface>
<fm:run-query interface="dbint-dual" query="qry-sysdate"/>
Query to uppercase CD track titles
<fm:db-interface name="dbint-dual">
<fm:query name="qry-uppercase">
<fm:select>
SELECT upper(:fname) “forename”
FROM dual
</fm:select>
<fm:using name="fname">./FORENAME</fm:using>
</fm:query>
</fm:db-interface>
NB: “forename” matches on DOM elements in order to replace the current element with the new value
<fm:run-query interface="dbint-dual" query="qry-uppercase" match="/*/EMPLOYEE_LIST/EMPLOYEE"/>
In your copy of XX_EMPLOYEEMODULE (where XX are your initials), create an action called “action-change-date” that will run a query to convert the HIRE_DATE for each employee to the day of hire. This will require you to use what you have learned from Chapters 24 to 27.