In this section: |
This topic explains how the Adapter for Supra allows you to describe and report from Supra database views. You should become familiar with these topics, because most of the concepts affect the way Supra files are described to the server.
When the server accesses a data source, it needs information on how to interpret the data stored there. For each data source the server will access, you create a synonym that describes the structure of the data source and the server mapping of the Supra data types.
Reference: |
The syntax for describing a Supra database in a Master File is like that of any other Master File and uses the same keywords. A Master File can contain a File record, Segment records, and Field records. The keywords are described in the following sections.
Keyword |
Format or Value |
---|---|
FILENAME |
Arbitrary name up to eight characters in length. |
SUFFIX |
Is SUPRA when accessing RDM or PDM data using the Supra RDM. If RDM is not available, the SUFFIX=TOTIN is used for PDM data access. For more information, see Supra PDM. |
Keyword |
Format or Value |
---|---|
SEGNAME |
Segment name. |
SEGTYPE |
Segment type. Sn means that the first n fields are components of the key, in the order listed. This information is used only if the Access file is missing, or if no value is specified for the KEYNAME attribute of the Access File. If the two values disagree, the value specified in the Access File is retained. A message is displayed only if FSTRACE is allocated to the screen or to a file. |
PARENT |
Segment name of the parent. If you describe several Supra views or user views as a hierarchical structure in one Master File, then you must define one view as the root segment and all other views as descendant segments. Each descendant segment must include the PARENT attribute to identify its parent in the hierarchy. You must also identify the shared fields for each pair of segments by specifying the KEYFLD and IXFLD attributes in the Access File. |
Keyword |
Format or Value |
---|---|
FIELD |
Any name; 66 characters is the maximum length. |
ALIAS |
Name of the view column as defined to Supra. The total length must not exceed 66 characters. |
USAGE |
USAGE format values are A (Alpha), I (Integer), F (Floating point), D (Decimal), or P (Packed). |
ACTUAL |
Specifies the actual Supra format (that is, the format defined by the DBA in the view definition that an application program would use for accessing the data). Some examples of Supra formats and their corresponding ACTUAL formats are:
|
Note: You can place different views into one Master File. If they have shared fields (fields with the same value in both views), then one view is described as the parent segment, and the other views are described as the child segments.
Reference: |
The Access File provides the information necessary for selecting the appropriate Supra database, view, and access strategy (that is, the linking of items between different tables).
A logical record in the Access File consists of a list of attributes (keyword = value pairs) separated by commas and terminated by a comma and dollar sign (,$). The list is freeform and can span several lines. The keywords can be specified in any order.
The Access File contains two types of logical records: HEADER and SEGMENT.
Keyword |
Value |
---|---|
USER |
Supra user name. If omitted, it defaults to FOCUS. |
PASSWORD |
Supra user password. If omitted, it defaults to FOCUS. |
Keyword |
Value |
---|---|
SEGNAME |
Segment name. |
VIEW |
Supra view (defaults to SEGNAME). |
USERVIEW |
Supra user view corresponding to the segment identified by segname (defaults to VIEW). |
KEYNAME |
Composite of at most nine field names that constitute the key of the view. The field names are concatenated with the symbol "/", without intervening blanks. The keyword value can span more than one line. If omitted, the first n fields, as specified by the SEGTYPE keyword in the Master File, are assumed. |
KEYFLD |
Field name in the parent segment or a defined field that establishes the embedded cross reference. It is mandatory in all but the root segment. Its value is a composite of a maximum of 9 field names concatenated with the symbol "/", without blank spaces. The keyword value can span more than one line. |
IXFLD |
Field name in the descendant segment that establishes the embedded cross reference. It is mandatory for all but the root segment. The values of this field should match the values of the KEYFLD. The keyword value consists of a maximum of 9 field names concatenated with the symbol "/", without blanks. The keyword value can span more than one line. |
If your request references fields from two segments defined in the same Master File, the two views are automatically cross-referenced. The fields that implement the cross-reference are specified in the Access File with the KEYFLD and IXFLD attributes. The selection of the shared fields is transparent to you.
The following rules apply a:
In all cases, the length and the format of KEYFLD and IXFLD must be consistent (a list of fields may be joined to a simple field and vice versa, as long as their formats are alphanumeric).
iWay Software |