Access Files

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,$

Top of page

x
Segment Declarations in the Access File

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).



x
Syntax: How to Describe a Table or View in an Access File
SEGNAME=segname, TABLENAME= tableid [,DBSPACE=storage,]
  [,WRITE= {YES|NO}] [,KEYS= {0|n}] [,KEYORDER=sequence,]  ,$

where:

segname

Is the one- to eight-character SEGNAME value from the Master File.

tableid

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.

DBSPACE = storage

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.

WRITE = {YES|NO}

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.

KEYS = n

Indicates how many columns constitute the primary key. Is a value from 0 to 64. Zero is the default.

KEYORDER = sequence

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.



x
Reference: TABLENAME

The TABLENAME attribute specifies the RDBMS table name. This name may have multiple parts depending on the specific RDBMS.

Note:



x
Reference: DBSPACE

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.

Note:

The Access File DBSPACE attribute overrides both the SET command and the installation default.



x
Reference: WRITE

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:

YES

Specifies read and write access using FOCUS MODIFY and MAINTAIN. YES is the default value.

NO

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:



x
Reference: KEYS

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:

n

Is a value from 0 to 64. Zero is the default.

The KEYS value has the following significance in reporting operations

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).



x
Reference: KEYORDER

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:

sequence

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).



x
Reference: FALLBACK (Teradata Only)

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:

YES

Establishes a backup copy. The location is determined by Teradata and becomes available if the original copy becomes unavailable.

NO

Does not establish a backup copy. NO is the default value.



x
Reference: CONNECTION (Oracle Only)

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:

connection_name

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.


Top of page

x
Field Declarations (DB2 Only)

Access File field declarations define the precision type for DECIMAL fields.


Information Builders