Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Defining a View of a Source Table : Defining a Parameter Value (PRM) Table

Defining a Parameter Value (PRM) Table
Why Define a Table for Parameter Values?
When accessing the data of a parameterized table, you often require access to data in all the instances of the table. By defining a table to hold the data parameter values, you can relate this information in your data access. This relationship can be coded explicitly using a FORALL statement or implicitly using a tool interface. You must have DEF_PRM access to the source table to define a subview of it.
Behavior of Parameter Tables
Note the following when using a parameter value table:
Tasks Required to Define a Parameter Value Table
Complete the following tasks to define a parameter value 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 PRM. When you press Enter, a screen similar to the following appears.

 
COMMAND==> TABLE DEFINITION
Table: $@EMPLOYEES Type: PRM Unit: DOCEXMPL
Source:
PFKEYS: 3=END 12=CANCEL 22=DELETE 13=PRINT 14=FIELDS 21=DATA 2=DOC

 
Task B Specifying the source table
In the Source field, type in the name of the table that is used as your source of data. The source table must already exist and it must be a parameterized table of one of the following:
Using the NUMBER Field in a Parameter Table
A parameter table is a virtual table, meaning that its data is extracted from dynamic source information. The NUMBER field of the parameter table depends on the following:
Therefore, since the values in the NUMBER field are dynamic, it cannot be used in any meaningful way and should be ignored. For example, the NUMBER field for parameter instance A has a value of one but on the following day the NUMBER field (for parameter instance A) could equal 2 because a new parameter instance is added.
Sample Parameter Value Table
The following example illustrates a sample parameter value table:

 
BROWSING TABLE : $@EMPLOYEES
COMMAND ==>
SCROLL: P
NUMBER REGION
_ ----------- ----------------
_ 1 CANADA
_ 2 MEXICO
_ 3 MIDWEST
_ 4 SOUTHWEST
PFKEYS: 1=HELP 5=FIND NEXT 9=RECALL 18=EXCLUDE 13=PRINT 3=END 14=EXPAND

 
Example Rule for Parameter Values for a Table
The following rule uses FORALL statements to access and process data parameter values for a table.

 
RULE EDITOR ===> SCROLL: P
DEPT_EXPENSE(MEDIA);
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL $EMP_EXPENSE : ¦ 1
_ DEPT_EXPENSE.MONTH_NUMBER = $EMP_EXPENSE.MONTH; ¦
_ FORALL EMP_EXPENSE($EMP_EXPENSE.MONTH) : ¦
_ DEPT_EXPENSE.* = EMP_EXPENSE.*; ¦
_ INSERT DEPT_EXPNSE('DEPT_EXPENSE'); ¦
_ END; ¦
_ END; ¦
_ CALL $RPTPRINT('DEPT_EXPNSE', MEDIA); ¦ 2
_ ---------------------------------------------------------------------------

 
Explanation of the Rule
The rule does the following:
1.
2.
3.
4.
5.
See Also
TIBCO Object Service Broker Programming in Rules for information about the FORALL statement.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved