Example 3 - using DBQUERY to provide map input to RUN function
In another example, assume that you have an input file containing one order record. To map that order to another proprietary format, you also have a PARTS table with pricing information for every part for every customer-a very large table. Rather than using the entire PARTS table as the input to your map, you might include the RUN function with your Syntax1-formatted DBQUERY to dynamically select only those rows from the PARTS table corresponding to the customer in the order file, as follows:
RUN("MapOrder.MMC",
"-IE2'" + DBQUERY ("SELECT * FROM PARTS WHERE CustID =" +
CustomerNo:OrderRecord:OrderFile +
" ORDER BY PARTNO",
"PartsDB.MDQ",
"PartsDatabase") +"'")