DTW_TB_COLS

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

Purpose

Returns the number of columns in a Net.Data table.

Format

@DTW_TB_COLS(table, cols)

@DTW_TB_rCOLS(table)

Parameters

Table 122. DTW_TB_COLS Parameters
Data Type Parameter Use Description
table table IN The macro table variable for which the number of columns are returned.
integer cols OUT A variable that contains the number of columns in table.

Return Codes

Table 123. DTW_TB_COLS 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 An incorrect number of parameters were passed on a function call.
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.

Examples

Example 1: Retrieves the number of columns and assigns the value to cols

%DEFINE myTable = %TABLE
%DEFINE cols = ""
...
@FillTable(myTable)
...
@DTW_TB_COLS(myTable, cols)

Example 2: Retrieves and displays the value for the current number of columns in the table

%DEFINE myTable = %TABLE
...
@FillTable(myTable)
...
<p>My table contains @DTW_TB_rCOLS(myTable) columns.</p>


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