Home page  
Help >
ddlShow() - show tree values
Version 7.11
ddlShow() - show tree values ddlShow() - show tree values

Prototype:
   void ddlShow(
      CONTROL *ctl,
      char *OptnStr,
      char *ArgList);

Permitted values in OptnStr:
   /H - print high value only
   /L - print low value only
   /T - print totals only

Form of ArgList:
1) <key-name> [<expression>]
2) <cx> [<table-name>] <field-name>
<key-name> represents the name of a keyed field;
<cx> represents a collection name;
<table-name> represents the name of a table;
<field-name> represents the name of a field;
<expression> may be one of the following forms:
     EQ v1
     EQ v1,v2,...
     {GT/GE} v1
     {GT/GE} v1 {THRU/TO} v2
     {GT/GE} v1 {THRU/TO} v2,v3 {THRU/TO} v4, ...
     [there is also an implied EQ; for example:
         <key-name> value OR
         <key-name> 'value'

Description:
All forms of the ddlShow() function display a list of values and their frequency for an index or a collection unless the /X option is used.

All printing performed by the ddlShow() function is achieved thru a user callback, as specified in the ddlPrintCallback() function.

When the /L option (show low value) or the /H option (show high value) is invoked, the result excludes SQL null.

Values returned in Control Structure: [for /L, /H]
Control.Ans1 Number of instances for value
Control.Ans2str[] Value for /L or /H
Control.Ans1Double For data types F and FD, this is the binary 64-bit floating value
Control.Ans1L For data types I, IU, ID, IDU, ID64 and IDU64, this is the binary 64-bit integer value

Values returned in Control Structure: [other than /L, /H]
Control.Ans1 Total number of instances for all values
Control.Ans2 Number of unique values



Transferring index meta-data to a table

There is a special form of SHOW that writes node counts and node values to a table.

5) SHOW/W <key-name> <cxW> <tableW> <fname-countW> <fname-valueW>
6) SHOW/W <cx> [<table-name>] <field-name> [<field-name2> ...]
             <cxW> <tableW> <fname-countW> <fname-valueW>
key-name represents the name of a keyed field;
cx represents a collection name;
table-name represents the name of a table;
cxW represents the collection for the records to be written;
tableW represents the table for the records to be written;
fname-countW represents the field for the node count to be written;
fname-valueW represents the field for the node value to be written;


There is a fairly severe restriction on this form: the target table, TableW, can have no keys.

Using SHOW With Piggy-Back Index to Calculate Aggregate

This is an extension of SHOW/W that computes simple aggregates using index data only.

7) SHOW/W <key-name> [WHERE <expression>] [BY <key-value>] ...
             TO <cxW> <tableW> <fname-countW> <fname-valueW> [<fname-aggW> = <fname[SUM]>]...
8) SHOW/W <cx> <table-name> <field-name>
             TO <cxW> <table-nameW> <fname-countW> <fname-valueW> [<fname-aggW> = <fname[SUM]>]...
key-name represents the name of a keyed field;
cx represents a collection name;
table-name represents the name of a table;
cxW represents the collection for the records to be written;
tableW represents the table for the records to be written;
fname-countW represents the field for the node count to be written;
fname-valueW represents the field for the node value to be written;

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.