Anchor references are commonly called hyperlinks or simply links. Using links, you specify the Web macro and HTML block name to invoke Net.Data. You can place text or graphics in the link. When people click on the linked text or graphic, they invoke the Net.Data macro. This is an example of a canned query that you can invoke from a Web page using a link. (A canned query is an SQL query that does not require input.)
<a href="http://www.ibm.com/cgi-bin/db2www/listA.mac/report"> List all monitors</a>
The link calls this macro:
%DEFINE DATABASE="MNS97"
%FUNCTION(DTW_SQL) myQuery(){
SELECT MODNO, COST, DESCRIP FROM EQPTABLE
WHERE TYPE='MONITOR'
%}
%HTML(report){
@myQuery()
%}
This query returns a table of all the monitors, including the model
number, cost, and description for each. This example generates a default
report. See "Report Blocks" for information on customizing your reports with a REPORT block.
Generally, each block of a Net.Data macro begins with %block_name{ and ends with %}. See Net.Data Reference Guide for syntax details.