In this section: |
Each Master File has a corresponding Access File. The name of the Access File (member name in the z/OS partitioned data set allocated to DDNAME 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.
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,$
How to: Reference: |
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:
Is the one- to eight-character SEGNAME value from the Master File.
Is the RDBMS-specific table name.
For DB2, the format of the table name attribute is
[location.][creator.]table
For Teradata, the format of the table name attribute is
[databasename.]table
For Oracle, the format of the table name attribute is
userid.tablename
For IDMS/SQL, the format of the table name attribute is
[schema.]table
See TABLENAME for complete information.
Is an RDBMS-specific storage area for the table used by the CREATE FILE or HOLD FORMAT DB2, SQLDBC, SQLIDMS, or SQLORA commands.
For DB2 on z/OS
databasename.tablespacename or DATABASEdatabasename
For Teradata, N/A.
For IDMS/SQL, the format of the DBSPACE attribute is
segment.area
For Oracle, the format of the DBSPACE attribute is
tablespacename
See DBSPACE for complete information.
YES specifies read and write access using MODIFY and MAINTAIN. YES is the default value.
NO specifies read-only access using FOCUS MODIFY and MAINTAIN.
Indicates how many columns constitute the primary key. Is a value from 0 to 64. Zero is the default.
Indicates the primary key sort sequence. Valid values are as follows:
LOW indicates ascending primary key sort sequence. LOW is the default.
ASC is a synonym for LOW.
HIGH indicates descending primary key sort sequence.
DESC is a synonym for HIGH.
The TABLENAME attribute specifies the RDBMS table name. This name may have multiple parts depending on the specific RDBMS.
TABLENAME = [location.][creator.]table
where:
Is the DB2 subsystem location name for the Distributed Data Facility, 16 characters maximum.
Defaults to the current authorization ID if not specified. Eight characters maximum.
Is the name of the RDBMS table or view, 18 characters maximum.
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.
TABLENAME = [databasename.]table
where:
Is the name of the database where the table resides, 30 characters maximum. The default is the database name assigned to your Teradata logon ID, provided one exists.
Is the name of the table of view, 30 characters maximum.
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.
TABLENAME = [schema.]table
where:
Is the IDMS SQL schema name for the table or view. Eight characters maximum. If not specified, IDMS searches for a temporary table definition for the named table. If that does not exist, IDMS uses the current schema in effect for the current user session.
Is the name of the table or view, 17 characters maximum.
The maximum IDMS length for a fully qualified table name is 25. All names must conform to the CA-IDMS rules for identifiers.
TABLENAME = [creator.]tablename[@dblinkname]
where:
Is the Oracle userid, up to 30 characters in length.
Is the name of the Oracle table being described, up to 30 characters in length.
Is a valid DATABASE LINK defined in the currently connected Oracle database server.
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, SQLDBC, SQLORA, or SQLIDMS commands.
DBSPACE = databasename.tablespacename
or
DBSPACE = DATABASE databasename
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.)
DBSPACE = segment.area
where:
Is the IDMS SQL segment name to be used for the CREATE TABLE DDL resulting from a CREATE FILE or HOLD FORMAT SQLIDMS command. If not specified, IDMS uses the default area associated with the schema.
Is the IDMS SQL segment name to be used for the CREATE TABLE DDL resulting from a CREATE FILE or HOLD FORMAT SQLIDMS command. If not specified, IDMS uses the default area associated with the schema.
DBSPACE = 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 adapter allows FOCUS MODIFY and MAINTAIN operations (INCLUDE, UPDATE, or DELETE) on the table. The syntax is
WRITE = {YES|NO}
where:
Specifies read and write access using FOCUS MODIFY and MAINTAIN. YES is the default value.
Specifies read-only access using FOCUS TABLE, MAINTAIN, and MODIFY. You can use MODIFY or MAINTAIN read-only functions, such as MATCH, NEXT, CRTFORM, or WINFORM, to display rows.
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:
Is a value from 0 to 64. Zero is the default.
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 adapter uses the KEYORDER value when you specify FST. and LST. direct operators in report requests. The syntax is
KEYORDER= sequence ,
where:
Indicates the primary key sort sequence. Valid values are as follows:
LOW sorts the rows in ascending primary key sequence. LOW is the default value.
ASC is a synonym for LOW.
HIGH sorts the rows in descending primary key sequence.
DESC is a synonym for HIGH.
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 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 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:
Establishes a backup copy. The location is determined by Teradata and becomes available if the original copy becomes unavailable.
Does not establish a backup copy. NO is the default value.
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, and is supported for compatibility with earlier releases.
CONNECTION=connection_name
where:
Is the TNSNAME used to connect to an Oracle database server. This name must have been previously referenced in a SET CONNECTION_ATTRIBUTES command. See Connection, Authentication, and Security, for information about the SET CONNECTION_ATTRIBUTES command.
Access File field declarations define the precision type for DECIMAL fields.
Information Builders |