AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
The column name returned by a function call or query for column n.
You can reference Nn in REPORT and ROW blocks.
Examples
Example 1: A variable reference for a column name
The name of column 2 is $(N2).
Example 2: Saves the value of a column name for use outside a REPORT block using DTW_ASSIGN
%define col1="" ... %function (DTW_SQL) myfunc() { select * from atable %report { @dtw_assign(col1, N1) %row{ %} %} %} %html(report) { @myfunc() The column name for the first column is $(col1) %}This example shows how you can use this variable outside the REPORT block by using DTW_ASSIGN. For more information, see DTW_ASSIGN.
Example 3: Nn within an HTML table to define column names
%REPORT{ <H2>Product directory</H2> <TABLE BORDER=1 CELLPADDING=3> <TR><TD>$(N1)</TD><TD>$(N2)</TD><TD>$(N3)</TD> %ROW{ <TR><TD>$(V1)</TD><TD>$(V2)</TD><TD>$(V3)</TD> %} </TABLE> %}