IBM Books

Reference

DTW_TB_GETN


AIX HP-UX Linux OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X X

Purpose

Returns a column heading from a Net.Data table.

Format

@DTW_TB_GETN(table, col, name)

@DTW_TB_rGETN(table, col)

Parameters

Table 132. DTW_TB_GETN Parameters

Data Type Parameter Use Description
table table IN The macro table variable from which a column name is returned.
integer col IN The column number of the column whose name is to be returned.
string name OUT A variable that contains the name of the column specified in col.

Return Codes

Table 133. DTW_TB_GETN Return Codes

Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1001 An input parameter contained a NULL value.
1003 The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function.
1004 A parameter passed on a function call, required to be a Net.Data macro table variable, was of a different variable type.
1005 A parameter passed on a function call, required to be a string variable, was of a different variable type.
1006 A literal string was passed on a function call for a parameter which was required to be an output parameter.
1007 A parameter contains a value which is not valid.
1008 A parameter is outside of table bounds.

Usage Notes

Before calling DTW_TB_GETN(), set the number of columns in the table. You can set the number of columns with the DTW_TB_SETCOLS() or DTW_TB_INSERTCOL() functions, or by passing the table to a language environment to be set.

Examples

Example 1: Retrieves the column name of column 4

%DEFINE myTable = %TABLE
%DEFINE name = ""
...
@FillTable(myTable)
...
@DTW_TB_GETN(myTable, "4", name)

Example 2: Retrieves the column name of the last column in the table

%DEFINE myTable = %TABLE
...
@FillTable(myTable)
...
<P>The column name of the last column is @DTW_TB_rGETN(myTable, @DTW_TB_rCOLS(myTable))


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]