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


Chapter 4 Managing DB2 Data Definitions : Task D  Select DB2 Columns

Task D  Select DB2 Columns
After selecting a DB2 table, you can select columns from it. On the Table Definition screen illustrated in Header Segment, place the cursor next to the DB2 column you want to select and use one of the following line commands:
Columns that are to be data parameters. You can choose up to four DB2 columns as data parameters. The Gateway forms a key out of these parameters (in sequence) followed by the TIBCO Object Service Broker primary key fields (in the order you specify in the Num field).
Columns that are to be the TIBCO Object Service Broker primary key fields. You can select up to 16 DB2 columns to form a composite primary key.
Columns to be fields in the TIBCO Object Service Broker DB2 table. If defining a stored procedure, all parameters are pre-selected as S.
The number of fields you can select is dependent upon the length of the sum of all fields, primary keys, data parameters and control information. This sum must be less than or equal to 31 Kbytes. For an explanation of the formula used to calculate the total number of bytes of all fields, refer to the TIBCO Object Service Broker Programming in Rules manual.
The number of fields you can access is dependent upon the CTABLESIZE Data Object Broker parameter. The ESTIMATETBLDFN rule, described in Estimating the CTABLESIZE Parameter, enables you to estimate the size of this parameter.
Select parameters and primary keys that, when combined, uniquely identify each DB2 occurrence, even though the DB2 table or view does not have unique keys defined for it. The Table Browser and Table Editor support up to eight composite primary keys. Use rules to access DB2 tables with more than eight primary keys.
TIBCO Object Service Broker Field Defaults
After selecting fields for the DB2 table, press Enter to display the default name, type, syntax, and length of these fields in the TIBCO Object Service Broker Field segment. When you press PF3 to save your selections and exit the Table Definer, a screen similar to the one shown here appears. The line commands remain visible, and you can change them by typing over them, or if you want to exclude a selected DB2 column, you can de-select it by typing a blank over the line command.

 
COMMAND==> TABLE DEFINITION
Table : CUSTOMER Type: DB2 Unit: RFS
Dictionary : X (X/I) ServerID: DEFAULT ServerType: DB2 Orders: Y ImplUpd: N
Subtype : N (N/P/R)
Creator : DSN8810
Table : CUST
DB2 Location:
 
Location Parm Default Src Sourcename ' Event Rule Typ Acc
---------------- -------------- --- ------------ ' ---------------- - -
_ LOCATION ' _
' _
 
| ----------- DB2 Column --------------------------|-------- OSB Field -------
Name Datatype Len Scale |Num Name Typ Syn
------------------------------ -------- ----- -Def|--- ---------------- - --
K CUST_ID CHAR 5 0 N 1 CUST_ID V
S NAME CHAR 30 0 Y 2 NAME V
S ADDR_1 CHAR 30 0 Y 3 ADDR_1 V
S ADDR_2 CHAR 30 0 Y 4 ADDR_2 V
S CITY CHAR 15 0 Y 5 CITY V
S STATE CHAR 2 0 Y 6 STATE V
S OPEN_$ DECIMAL 9 2 Y 7 OPEN_$ P
S PHONE CHAR 10 0 Y 8 PHONE V
(S=Select P=Parameter K=Key)
PFKEYS: 4=DB2 TBLS 3=END 12=CANCEL 2=DOC 22=DELETE 5=RS_INFO 9=RS_REFRESH

 
The screen above displays the default mapping of DB2 data types to TIBCO Object Service Broker semantic types and syntax. The default translations are shown in the following table. TIBCO Object Service Broker semantic types and syntax are described in TIBCO Object Service Broker Programming in Rules.
TIBCO Object Service Broker Semantic Type
TIBCO Object Service Broker Syntax
TIBCO Object Service Broker Length
8b
aIf you select a character type DB2 column as a parameter, it defaults to a TIBCO Object Service Broker fixed-length character string since TIBCO Object Service Broker syntax V is not supported for TIBCO Object Service Broker parameters.
bDB2 passes all TIME and TIMESTAMP data to applications in the default character format defined for the DB2 subsystem. The format is a DB2 installation parameter.
cThe DB2 DECIMAL type is defined with a precision specifying the total number of digits, and a scale specifying the number of decimal places. The TIBCO Object Service Broker length converts this to the appropriate number of packed bytes, and the number of decimal places remains the same. For example, a DB2 DECIMAL field of precision 8 and scale 2 is defined as length 5 and decimal places 2 in TIBCO Object Service Broker.
dDB2 graphic data types contain graphic symbols that consist of two bytes each. When you display these symbols in TIBCO Object Service Broker, they are mapped to TIBCO Object Service Broker character fields with twice that length.

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