Home page  
Help >
RELATE Full Explosion option
Version 7.11
RELATE Full Explosion option
The RELATE "Full Explosion" Option

The RELATE Command combines the data from two or more tables into a hierarchical arrangement.

The resulting hierarchical data can be considered as a series of logical records; with each logical record containing one record from each level of the hierarchy.

The processing required by an application to convert a hierarchy into a series of logical records is made much simpler if the hierarchy contains a complete and consecutive sub-hierarchy for each logical record. This is called a Full Explosion.

The traditional Thunderbolt RELATE Command does not produce a Full Explosion under all circumstances. So, beginning in Version 8.0.0 of the Thundebolt RAD & Thunderbolt API, the command option /P has been added to create a full explosion.

Consider a schema consisting of 9 tables:
   Table1 ...
      ...
   Table2 ...
      ...
   Table3 ...
      ...
   Table4 ...
      ...
   Table5 ...
      ...
   Table6 ...
      ...
   Table7 ...
      ...
   Table8 ...
      ...
   Table9 ...
      ...
And consider the following RELATE command:
   RELATE A Table1                                                  -
            (Table2 thru ... (Table3 thru ... ))                    -
            (Table4 thru ... (Table5 thru ... (Table6 thru ...)))   -
            (Table7 thru ... (Table8 thru ...))                     -
            (Table9 thru ... ) ...
This RELATE produces a hierarchy as follows:
    Table1
      Table2
        Table3
      Table4
        Table5
          Table6
      Table7
        Table8
      Table9
The traditional explosion for this RELATE for a hypothetical set of data is shown below; we use the notation:
      Table1-N etc
to mean the Nth result record for Table1, eyc.
      Table1-1
        Table2-1
          Table3-1
        Table4-1
          Table5-1
             Table6-1 
        Table4-2
          Table5-2
             Table6-2  
        Table4-3
          Table5-3
             Table6-3
        Table7-1
          Table8-1
        Table7-2
          Table8-2
        Table9-1
The same explosion with the /P option is shown below; the additional data is indented for emphasis:
      Table1-1
        Table2-1
          Table3-1
        Table4-1
          Table5-1
             Table6-1 
                       Table7-1
                           Table8-1
                       Table9-1
                       Table7-2
                           Table8-2
                       Table9-1
        Table4-2
          Table5-2
             Table6-2  
                       Table7-1
                           Table8-1
                       Table9-1
                       Table7-2
                           Table8-2
                       Table9-1
        Table4-3
          Table5-3
             Table6-3
        Table7-1
          Table8-1
        Table7-2
          Table8-2
        Table9-1

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.