Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 4 Defining a View of a Source Table : Defining a Calculation (CLC) Table

Defining a Calculation (CLC) Table
Why Define a Calculation View?
Often, when accessing data, a simple count of the fields that contain the same values within a table is required as part of the data access. Using a calculation table, the values can be accessed via a source table and counted. The values are dynamically updated for you each time a change is made to the source table. You must have DEF_VIEW access to the source table to define a calculation view of it.
Behavior of Calculation Tables
Note the following when using a calculation table:
For performance reasons, if only one field is being counted, the field should have a secondary key built on it, if this is allowed for its syntax, before the calculation table is accessed.
See Also
TIBCO Object Service Broker Programming in Rules for information on which fields, depending on their syntax, can be defined as secondary keys.
TIBCO Object Service Broker Application Administion for more information on secondary keys.
Tasks Required to Define a Calculation Table
Complete the following tasks to define a calculation table:
The following sections provide more information on these tasks.
 
Task A Specify the table type
After entering the initial Table Definer screen described in Accessing the Table Definer, you must change the table type field to CLC. When you press Enter, a screen similar to the following appears.

 
COMMAND==> TABLE DEFINITION
Table: @EMPLOYEES_CLC Type: CLC Unit: DOCEXMPL
Source:
Parameter Name Typ Syn Len Dec Class Default Src Sourcename
---------------- - -- --- -- - ---------------- --- ----------------
_
_
Field Name Type Syntax Length Decimal Key Ord Src Source Name
---------------- - -- ---- -- - - - ----------------
_
_
_
_
_
_
_
_
_
_
_
PFKEYS: 3=END 12=CANCEL 22=DELETE 13=PRINT 14=FIELDS 21=DATA 2=DOC
Table type changed

 
Task B Specify the source table
In the Source field, enter the name of the table that is your source of data. The source table must already exist and it must be a TDS table. When you provide the source name and press Enter, the screen is populated with values from the source table.
Task C Verify the parameters
The parameter values are provided for you when you press Enter after specifying a source table name. These values must not be changed.
Task D Define the primary key and non-key fields
The field values are provided for you when you press Enter after specifying a source table name. In addition, a new primary key field named KEY and a new non-key field named COUNT are added and defined, and two new fields called Src and Source Name are added.
Except for the KEY and COUNT fields, delete the fields that are not to be counted. You can use the D line command to delete the fields. The names for the KEY and COUNT fields can be changed but you must not change the default attributes for these fields.
Sample Calculation Table
The following example illustrates a sample calculation table:

 
BROWSING TABLE : @EMPLOYEES_CLC(MIDWEST)
COMMAND ==>
SCROLL: P
KEY POSITION MGR# COUNT
_ ----------- -------------- ------ -----------
_ 1 ACCOUNTANT 98895 1
_ 2 ANALYST 79912 3
_ 3 CUST SUPPORT 56112 3
_ 4 EDUCATOR 80002 2
_ 5 EDUCATOR 98895 1
_ 6 JR OPERATOR 44798 1
_ 7 JR PROGRAMMER 79912 1
_ 8 MANAGER 99999 2
_ 9 PRE-SALES 37219 2
_ 10 SALES 37219 1
_ 11 SENIOR ANALYST 79912 2
_ 12 TECH WRITER 80002 2
_ 13 TESTER 79912 1
PFKEYS: 1=HELP 5=FIND NEXT 9=RECALL 18=EXCLUDE 13=PRINT 3=END 14=EXPAND

 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved