IBM Books

Reference

DTW_TB_SETCOLS


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

Purpose

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

Format

@DTW_TB_SETCOLS(table, cols)

Parameters

Table 156. DTW_TB_SETCOLS Parameters

Data Type Parameter Use Description
table table INOUT The macro table variable for which the number of columns is set.
integer cols IN The initial number of columns to allocate in table.

Return Codes

Table 157. DTW_TB_SETCOLS 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.
1007 A parameter contains a value which is not valid.

Usage Notes

  1. The DTW_TB_SETCOLS() function can only be used once for a table. Afterwards, use the DTW_TB_DELETECOL() or DTW_TB_INSERTCOL() functions to change the number of columns in the table.
  2. Specify the column headings by using the DTW_TB_SETN() function.

Examples

Example 1: Allocates three columns for the table and assigns the names to the columns

%DEFINE myTable = %TABLE
 
@DTW_TB_SETCOLS(myTable, "3")
@DTW_TB_SETN(myTable, "Name", "1")
@DTW_TB_SETN(myTable, "Address", "2")
@DTW_TB_SETN(myTable, "Phone", "3")


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