Each Master File has a corresponding Access File. The name of the Access File (member name in the MVS partitioned data set allocated to DDNAME FOCSQL, or CMS file name with file type FOCSQL) must be identical to that of the Master File or, in the case of a remote segment description can be described in the cross-referenced Access File. The Access File associates a segment in the Master File with the table it describes. |
In this section: Segment Declarations in the Access File Field Declarations (DB2 and DB2 for VM Only) How to: Describe a Table or View in a Master File Reference: |
The Access File must identify the table and primary key (if there is one). It may also indicate the logical sort order of data and identify storage areas for the table. Access File field declarations can define the precision of packed fields.
For multi-table structures, the Access File also contains KEYFLD and IXFLD attributes that implement embedded equijoins. See Multi-Table Structures, for details.
The following is an Access File for the DB2 table EMPINFO:
SEGNAME = EMPINFO, TABLENAME = "USER1"."EMPINFO", KEYS = 1,
WRITE = YES, DBSPACE = PUBLIC.SPACE0,$
The segment declaration in the Access File establishes the link between the Master File and the RDBMS table or view. Attributes that constitute the segment declaration are: SEGNAME, TABLENAME, DBSPACE, WRITE, KEYS, and KEYORDER. Values for SEGNAME and TABLENAME are required; the remaining attributes acquire default values if they are omitted.
Teradata supports the FALLBACK attribute described in FALLBACK (Teradata Only).
Oracle supports the CONNECTION attribute described in CONNECTION (Oracle Only).
SEGNAME=segname, TABLENAME= tableid [,DBSPACE=storage,]
[,WRITE= {YES|NO}] [,KEYS= {0|n}] [,KEYORDER=sequence,] ,$
where:
The TABLENAME attribute specifies the RDBMS table name. This name may have multiple parts depending on the specific RDBMS.
RDBMS |
TABLENAME = |
DB2 and DB2 for VM |
[location.][creator.]table where:
The TABLENAME attribute identifies the RDBMS table or view. It should contain both the creator ID and the table name. If not specified, the creator defaults to the current authorization ID. The maximum length for a fully-qualified table name is 44. For a discussion of FOCUS support for the DB2 Distributed Data Facility, see Additional Topics. All names must conform to the rules for identifiers stated in the appropriate RDBMS manual. |
Teradata |
[databasename.]table where:
In Teradata, the maximum length of a fully-qualified table name is 61 characters including the required period (.). Database and table name may consist of uppercase letters (A through Z) and digits (0 through 9). Special characters, dollar sign ($), pound sign (#), and underscore (_) are also permitted. |
IDMS/SQL |
[schema.]table where:
The maximum IDMS length for a fully qualified table name is 25. All names must conform to the CA-IDMS rules for identifiers. |
Oracle |
[creator.]tablename[@dblinkname] where:
|
Note:
TABLENAME = 'USER1."TABLE$1"'
The DBSPACE attribute is an RDBMS-specific storage area for the table used by the CREATE FILE or HOLD FORMAT DB2, SQL, SQLDBC, SQLORA, or SQLIDMS commands:
RDBMS |
DBSPACE = |
DB2 |
databasename.tablespacename or
The storage areas identified by the DBSPACE attribute are called tablespaces in DB2. The IBM default value is DSNDB04, a public database. (DB2 automatically generates a tablespace in DSNDB04.) |
DB2 for VM |
owner.dbspace The storage areas identified by the DBSPACE attribute are called dbspaces in DB2 for VM. The default value is the DB2 for VM authorization ID's private DBSPACE. |
Teradata |
N/A |
IDMS/SQL |
segment.area where:
|
Oracle |
tablespacename |
Note:
The Access File DBSPACE attribute overrides both the SET command and the installation default.
The read/write security attribute, WRITE, determines whether or not the data adapter allows FOCUS MODIFY and MAINTAIN operations (INCLUDE, UPDATE, or DELETE) on the table. The syntax is
WRITE = {YES|NO}
where:
Note:
The KEYS attribute indicates how many columns constitute the primary key for the table. Acceptable values range from 0 to 64. Zero, the default, indicates that the table does not have a primary key. In the corresponding Master File, primary key columns must correspond to the first n fields described.
The syntax is
KEYS = {0|n} ,
where:
The KEYS value has the following significance in reporting operations:
Note:
LST. processing is automatically invoked if you request SUM or WRITE of an alphanumeric field or use one in a report heading or footing.
To provide consistent access to tables, you should specify the KEYS attribute whenever a primary key exists.
The KEYS value also has significance in MODIFY operations (see Maintaining Tables With FOCUS, for a detailed explanation).
The KEYORDER attribute is optional. It specifies the logical sort sequence of data by the primary key; it does not affect the physical storage of data. The data adapter uses the KEYORDER value when you specify FST. and LST. direct operators in report requests. The syntax is
KEYORDER= sequence ,
where:
For example, to retrieve the most recent pay dates first, specify KEYORDER = HIGH for the SALINFO table:
SEGNAME = SALINFO, TABLENAME = "USER1"."SALINFO", KEYS = 2,
WRITE = YES, KEYORDER = HIGH, DBSPACE = PUBLIC.SPACE0,$
The data adapter requests rows ordered by SALEID and PAY_DATE in descending order. FST.PAY_DATE retrieves the most recent salary data for each employee. See the Master File for SALINFO in File Descriptions and Tables.
KEYORDER also determines the logical sort order for MODIFY and MAINTAIN NEXT subcommands (see Maintaining Tables With FOCUS).
The FALLBACK attribute indicates whether a secondary copy of data is maintained in addition to the primary table. The data adapter incorporates this backup operation while creating a table in response to the FOCUS CREATE FILE command. You can also specify the FALLBACK parameter in native SQL/DBC CREATE TABLE statements.
The syntax is
FALLBACK = {YES|NO}
where:
The CONNECTION attribute selects a specific connection name from the list of Oracle database servers declared using the SET CONNECTION_ATTRIBUTES command. This setting supersedes the default connection in any request that references the Master and Access File pair. SERVER is a synonym for CONNECTION that is supported for compatibility with earlier releases.
CONNECTION=connection_name
where:
Access File field declarations define the precision type for DECIMAL fields.
Static TABLE requests can contain SQL host variables (see Static SQL (DB2 and DB2 for VM)). When you use these variables in an SQL predicate, the RDBMS optimizer considers them for indexed access only if they have the same precision as the corresponding RDBMS columns.
The ACTUAL attribute from the Master File does not provide enough information for determining the RDBMS column precision of DECIMAL columns. For example, an ACTUAL attribute of P6 can correspond to a DECIMAL column of precision 10 or 11.
The PRECISION attribute in the Access File defines the precision for DECIMAL columns. The syntax is
FIELD = fieldname, PRECISION = {ODD|EVEN} , $
where:
For example, an ACTUAL of P6 and a precision-type of ODD (the default) makes the host variable length 11; the RDBMS can consider index access if the RDBMS column precision is 11 (provided the column is indexed). With precision-type EVEN, the host variable length is 10, which enables index access for DECIMAL columns of precision 10.
Note: The DB2 for VM optimizer in Version 3 Release 4 and below does not allow index access from static SQL for packed decimal columns of even precision, regardless of the precision-type used.
Information Builders |