Daylight v4.9
Release Date: 1 February 2008


dt_mer_alloc_column - create a column of data in a pool

Generic Prototype

dt_mer_alloc_column(dt_Handle, dt_Handle, dt_Integer) => dt_Handle

C Prototype

#include "dt_merlin.h"

dt_Handle dt_mer_alloc_column(dt_Handle pool, dt_Handle fieldtype, dt_Integer func)

FORTRAN Prototype

include ''

integer*4 dt_f_mer_alloc_column(pool, fieldtype, func)

integer*4 pool
integer*4 fieldtype
integer*4 func


Creates a column object of data from the database 'pool', using the datafield specified by 'fieldtype' and the function 'func'.

The valid functions are defined as follows (in all cases, the definition relates to occurrences of the field in the TDT):

  DX_FUNC_FIRST    selects the first occurrence.
  DX_FUNC_LAST     selects the last occurrence.
  DX_FUNC_MIN      selects the lowest-valued occurrence, 
                   which for numeric fields uses 
                   the "<" test and for ASCII fields 
                   is the lowest lexically.
  DX_FUNC_MAX      selects the highest-valued occurrence.
  DX_FUNC_LONGEST  selects the longest (string length)
  DX_FUNC_SHORTEST selects the shortest (string length)
The following functions create columns of data derived from all occurrences of the fieldtype in the TDT. If a particular TDT has no occurrences of the fieldtype, the derived cell will contain "not available":
  DX_FUNC_AVG      average of the field (must be numeric).
  DX_FUNC_STDDEV   standard deviation (must be numeric).
  DX_FUNC_COUNT    count of occurrences.
The special function, DX_FUNC_ALL, creates a column of "pseudo-data" which in effect has all of the occurrences of the specified fieldtype in it. The column initially appears empty; when a search is performed, all occurrences of the specified fieldtype are searched. If a field of the specified type matches the search criteria, that field becomes the column's value for the row.

Return Value

Returns the columns handle, or the NULL_OB if inappropriate objects or function types are given as arguments.

Related Topics

dt_mer_cellvalue(3) dt_mer_defaultsort(3) dt_mer_funcapplies(3) dt_mer_function(3) dt_mer_getdata(3) dt_mer_getnitems(3) dt_mer_getroot(3) dt_mer_server(3) dt_mer_sortapplies(3)