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 Subview (SUB) Table

Defining a Subview (SUB) Table
Why Define a Subview?
A subview, which is a limited view of a source data table at either a local or remote location, aids in data privacy, increases data security, and often simplifies data access. Changes made in a subview are reflected in the source table but a user of a subview does not have full access to all the data in the source table. You must have DEF_VIEW access to the source table to define a subview of it.
Behavior of Subviews
The following table describes the behavior of fields, event rules, and parameters as defined in the source and subview tables:
Fields in the source table not defined in the subview.
Fields in the source table defined in the subview.
Can be part of either the selection criteria or defined as parameters to the subview.
Tasks Required to Define a Subview
Complete the following tasks to define a subview table. These tasks are described in the following sections.
See Also
Refer to Defining a Subview on a Minimal Definition for the tasks required to define a subview on a minimal table definition.
 
Task A Specify the table type
After entering the initial Table Definer screen, described in Accessing the Table Definer, you must change the Type field to SUB. When you press Enter, a screen similar to the following appears.

 
COMMAND==> TABLE DEFINITION
Table: @EMPLOYEES_SUB Type: SUB Unit: DOCEXMPL
Source:
Select:
Lock Mode:
Parameter Name Typ Syn Len Dec Class Src Source Name Default
---------------- - -- --- -- - - ---------------- ----------------
_
_
Synt Dec Order
Field Name Type Len Key Rqd Default 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, type the name of the table that is your source of data. The source table must already exist and it must be one of the following types of tables: TDS,VSM, DB2, DAT, IDM, IMS, SLK, ADA, or IMP.
When the source name is provided and you press Enter, the screen is populated with parameter and field names from the source table. The parameter types and primary key are also identified. The values supplied can be edited.
Task C Specify the lock mode
In the Lock Mode field, type in B if you do not want locks to be taken on the data. If locks are not taken, users can only browse the data. Type in D if you want the transaction to determine whether updates are allowed.
Task D Select the data
In the Select field, enter selection criteria for data for the subview. Occurrences being inserted into or deleted from the table must meet the selection criteria. For occurrences being replaced, both the old and new must meet the selection criteria. If no selection criteria is specified, all occurrences in the table are available for use.
The selection criteria must be a field name or a data parameter name from the source table, followed by a relational operator, followed by one of: a value; a field name from the source table; a new subview parameter; or an expression. The expression can include only a source field and a constant, or a defined parameter and a constant.
If a data parameter of the source table is not specified in the parameter area of the subview, it must be selected in the selection field as: source_parameter_name=value.
Example of Selection
To select occurrences that meet the following criteria: position of ANALYST or employees earning more than $400.00, and the source field MGR# set to the parameter MANAGER# in the subview, enter the following:
POSITION=’ANALYST’ | SALARY > 400.00 & MGR# = MANAGER#
Task E Define the parameters
Define the parameters in the same way as described in Task B: Define Parameters, except for the following differences:
A data parameter of a source table, if it is not defined in the subview, must be selected in the selection area of the subview screen as previously described.
A data parameter in a subview can be a field of the source table, but it must be selected in the selection area of the subview screen as previously described.
The names of the parameters can differ between the subview and the source table. If the names differ, the value in the Src field must be set to S and the name of the parameter in the source table must be provided in the Source Name field.
Task F Define the fields
Define the key and non-key fields in the same way as described in Task D: Define Primary Keys and Task E: Define Non-key Fields, noting the following:
Only the name and primary key setting of the source fields are imported from the source table. The other attributes, such as syntax and length, are left unspecified. Unless you override these other attributes in the subview table, they are inherited from the source table.
Setting a Value or Name
Use the Src field and Source Name field to set the value or name to be used, as shown in the following table:
If a functional rule is named, the table must be viewed and edited using the shareable tools STEBROWSE and STE. For information about these tools, refer to TIBCO Object Service Broker Shareable Tools. For information about coding the functional rule, refer to Chapter 7, Coding Considerations for Event, Location, and Derived Value Rules.
Sample Subview Table
The following example illustrates a sample subview table:

 
BROWSING TABLE : @EMPLOYEES_SUB(MIDWEST)
COMMAND ==>
SCROLL: P
EMPNO POSITION MANAGER# DEPTNO SALARY
_ ------ -------------- ------ ------ ---------
_ 22001 CUST SUPPORT 56112 30 900.00
_ 22007 CUST SUPPORT 56112 30 900.00
_ 30058 PRE-SALES 37219 20 675.00
_ 34111 PRE-SALES 37219 20 710.00
_ 34121 CUST SUPPORT 56112 30 700.00
_ 36162 JR OPERATOR 44798 80 575.00
_ 41001 TECH WRITER 80002 70 675.00
_ 41007 EDUCATOR 80002 60 700.00
_ 41009 TESTER 79912 50 600.00
_ 44385 SALES 37219 10 719.00
_ 44622 ACCOUNTANT 98895 40 800.00
_ 51111 ANALYST 79912 50 710.00
_ 51121 ANALYST 79912 50 700.00
_ 51162 JR PROGRAMMER 79912 50 575.00
_ 61219 SENIOR ANALYST 79912 50 820.00
_ 61385 EDUCATOR 80002 60 685.00
_ 61622 SENIOR ANALYST 79912 50 800.00
PFKEYS: 1=HELP 5=FIND NEXT 9=RECALL 18=EXCLUDE 13=PRINT 3=END 14=EXPAND

 

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