Home page  
Help >
ddlInvertIndex() - convert an index back into table form
Version 7.11
ddlInvertIndex() - convert an index back into table form

Prototype:
   void ddlInvertIndex(
      CONTROL *ctl,
      WtChar8 *OptnString,
      WtChar8 *ArgString,
      InvertFlEnum invertFlags,
      void *valueArray,
      WtInt32 valueArrayCount);
 
   typedef enum
     {
       InvertFlAll            = 0x0000,  // include all nodes in the tree
 
       InvertFlIncludeNull    = 0x0001,  // include only NULL
                                         // can be combined with InvertFlIncludeList
       InvertFlIncludeList    = 0x0004,  // include only the nodes in the list 
                                         // can be combined with InvertFlIncludeNull
 
       InvertFlExcludeNull    = 0x0002,  // include all nodes in the tree except NULL
                                         // can be combined with InvertFlExcludeList
       InvertFlExcludeList    = 0x0008   // include all nodes in the tree except those in the list
                                         // can be combined with InvertFlExcludeNull
     } InvertFlEnum;
 
   Meaningful combinations of InvertFlEnum values:
      InvertFlAll                                 -- include all nodes in the tree
 
      InvertFlIncludeList                         -- include only the nodes in the list 
      InvertFlIncludeNull                         -- include only NULL
      InvertFlIncludeList | InvertFlIncludeNull   -- include only the nodes in the list (including NULL)
 
      InvertFlExcludeList                         -- include all nodes except those in the list
      InvertFlExcludeNull                         -- include all nodes except NULL
      InvertFlExcludeList | IncludeFlExcludeNull  -- include all nodes except those in the list and NULL


Permitted values in OptnStr: NA

Form of ArgList:
      [<Source-Cx>] <Source-Key> [<Dest-CX>] <Dest-Table> <Dest-Column> [<range>] ...
            [{INCLUDE | EXCLUDE} [NULL] [<value-list>]]
                Where:
                    <Source-CX> if specified, <Source-CX> <Dest-Table> is the filter ANDed with the record list of each node
                    <Source-Key> is the name of the index that is to be inverted;
                           [<Source-Key> must represent a single-table key; and must be specified unambiguously;]
                    <Dest-CX> if specified, <Dest-CX> <Dest-Table> contains the collection of all records written
                    <Dest-Table> is the name of the table where the inverted data is to be placed;
                           [<Dest-Table> can contain no keys;]
                    <Dest-Column> is the column within <Dest-Table-Name> where data is to be placed;
                    <range> is the record range in the form <LowRec>,<HiRec> that is ANDed with the record list of each node
                    {INCLUDE | EXCLUDE} ... see Description

Description:
In its unqualified form:
      <Source-Key> [<Dest-CX>] <Dest-Table> <Dest-Column>
the ddlInvertIndex() API function performs the inverse function to the ddlStructure() API function. That is, for a specified index, it reads every node of the index and stores the node value into the respective rows of a target table, in accord with the row information that is included in the node. When it is complete, the specified column of the target table is an exact image of the original source column from which the index was built.

<Source-Key> must be an unambiguous reference. If required, <Source-Key> can be a fully qualified name, in both the tokenmap and non-tokenmap cases.

The rows of the <Dest-Table> must be pre-initialized by the caller.

There are four methods of modifying which nodes are processed and which rows are written to the destination table:
1) Source Filter If the <Source-CX> argument is specified in ArgList, then the collection <Source-CX> <Source-Table> is ANDed with the record list of each selected node before values are written to <Dest-Table>

<Source-Table> is the table containing <Source-Key>.

Source filter and Range may be specified singly or in combination.
2) Range If the <range> argument is specified in ArgList, then the range <LowRec>,<HiRec> is ANDed with the record list of each selected node before values are written to <Dest-Table>

Source filter and Range may be specified singly or in combination.
3) Parameterized include/exclude Node values to be included or excluded can be specified by the invertFlags, valueArray[] and valueArrayCount parameters.

If valueArray[] values are specified, they must be the same data type as the node values. [The data type of the node values can be obtained with the ddlVerify() function with the "SIGNATURE <table-name> <key-name> KEYTYPE" parameter.]
4) INCLUDE/EXCLUDE Clause The INCLUDE/EXCLUDE Clause in ArgList is an alternative method of specifying node values to be included or excluded.

INCLUDE indicates that only the enumerated values are to be inverted.

EXCLUDE indicates that all except the enumerated values are to be inverted.

<value-list> is a blank delimited list of values, enclosed in 's if necessary.


Values returned in Control Structure:
Control.Ans1 Number of nodes read
Control.Ans2 Number of records updated in target table

InvertIndex Examples

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.