Field design: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 15: Line 15:


== Combining Attributes ==
== Combining Attributes ==
==Combining attributes==
<p>When deciding on combinations of field attributes, use the chart in [[#Combining attributes|Combining attributes]] to see if the combination you want to use is valid, See [[#Key to table for combining attributes|Key to table for combining attributes]]. </p>
<table>
<caption>Field attribute combinations</caption>
<tr>
<th>Attribute</th>
<th>KEY</th>
<th>OCH</th>
<th>ONM</th>
<th>FRV</th>
<th>UNQ</th>
<th>NR</th>
<th>DEF</th>
<th>LVL</th>
<th>ONE</th>
<th>INV</th>
<th>STR</th>
<th>FLT</th>
<th>BIN</th>
<th>COD</th>
<th>FV</th>
<th>OCC</th>
<th>LEN</th>
<th>PAD</th>
<th>UPD</th>
<th>BLOB</th>
<th>CLOB</th>
</tr>
<tr>
<td>KEY</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>ORD CHAR (OCH)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>ORD NUM (ONM)</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>FRV</td>
<td>R</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>UNIQUE (UNQ)</td>
<td>&nbsp;</td>
<td>@</td>
<td>@</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>NUM RANGE (NR)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>=1</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>DEFERRABLE (DEF)</td>
<td>@</td>
<td>@</td>
<td>@</td>
<td>&nbsp;</td>
<td>N</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>LEVEL (LVL)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>AT-MOST-ONE (ONE)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>INVISIBLE (INV)</td>
<td>@</td>
<td>@</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>STRING (STR)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>FLOAT (FLT)</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>F</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>R</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>BINARY (BIN)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>CODED (COD)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>F</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>F</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>FEW VALUED (FV)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>OCCURS (OCC)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>=1</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>=1</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>@</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>LENGTH (LEN)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>@</td>
<td>N</td>
<td>F</td>
<td>&nbsp;</td>
<td>@</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>PAD</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>R</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>UPDATE (UPD)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>BINARY_LARGE_OBJECT (BLOB)</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>N</td>
</tr>
<tr>
<td>CHARACTER_LARGE_OBJECT (CLOB)</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>N</td>
<td>&nbsp;</td>
<td>N</td>
<td>&nbsp;</td>
</tr>
</table>
===Key to table for combining attributes===
<table>
<tr>
<th>Code </th>
<th>Meaning</th>
</tr>
<tr>
<td>N </td>
<td>This attribute combination is not legal.</td>
</tr>
<tr>
<td>R </td>
<td>This attribute combination is required.</td>
</tr>
<tr>
<td>@ </td>
<td>One of these attributes is required. You can choose any one of the attributes marked, but you must choose at least one.</td>
</tr>
<tr>
<td>=1</td>
<td>The OCCURS clause is valid with this attribute only if defined as OCCURS=1. You cannot enter multiple field values for fields with these attributes.</td>
</tr>
<tr>
<td>F </td>
<td>The FLOAT attribute requires the LEN attribute. Since the FLOAT attribute can also be used with the CODED attribute, this is the only circumstance that the LEN attribute is legal with CODED attribute.</td>
</tr>
</table>
<p>Some of the illegal combinations are direct conflicts, such as UNIQUE and DEFERRABLE; others describe meaningless situations or unusable fields, such as ORDERED CHARACTER and ORDERED NUMERIC. </p>
<p>In addition, some attributes <var class="term">require</var> other attributes. FLOAT, for example, requires a LENGTH specification. </p>
<p>Field descriptions that contain invalid combinations are rejected. </p>
<p>[[#Combining attributes|Combining attributes]] is for Entry Order files. More stringent restrictions are placed on fields that are used as sort keys, hash keys, or record security fields. These restrictions are summarized in the respective  [[:Category:Commands|Commands]] and [[:Category:Parameters|Parameters]] pages for each.


<div id="Field Naming">
<div id="Field Naming">

Revision as of 23:50, 24 March 2013


Indexing Fields

Representational Attributed

Field Constraints

Automatic Fields

Combining Attributes

Combining attributes

When deciding on combinations of field attributes, use the chart in Combining attributes to see if the combination you want to use is valid, See Key to table for combining attributes.

Field attribute combinations
Attribute KEY OCH ONM FRV UNQ NR DEF LVL ONE INV STR FLT BIN COD FV OCC LEN PAD UPD BLOB CLOB
KEY                                          
ORD CHAR (OCH)     N N               N                  
ORD NUM (ONM)   N   N   N                              
FRV R N N   N                                
UNIQUE (UNQ)   @ @ N     N                            
NUM RANGE (NR)     N                 N       =1          
DEFERRABLE (DEF) @ @ @   N @                              
LEVEL (LVL)                                          
AT-MOST-ONE (ONE)                   N                      
INVISIBLE (INV) @ @ @     @     N     N       N N N N    
STRING (STR)                       N N                
FLOAT (FLT)   N       N       N N   N F     R N      
BINARY (BIN)                     N N         N N      
CODED (COD)                       F         F N      
FEW VALUED (FV)         @                 @              
OCCURS (OCC)           =1     =1 N     @ @     @        
LENGTH (LEN)                   N   @ N F   @          
PAD                   N   N N N     R        
UPDATE (UPD)                   N                      
BINARY_LARGE_OBJECT (BLOB) N N N N N N N N N N   N N N N   N N     N
CHARACTER_LARGE_OBJECT (CLOB) N N N N N N N N N N   N N N N   N N   N  

Key to table for combining attributes

Code Meaning
N This attribute combination is not legal.
R This attribute combination is required.
@ One of these attributes is required. You can choose any one of the attributes marked, but you must choose at least one.
=1 The OCCURS clause is valid with this attribute only if defined as OCCURS=1. You cannot enter multiple field values for fields with these attributes.
F The FLOAT attribute requires the LEN attribute. Since the FLOAT attribute can also be used with the CODED attribute, this is the only circumstance that the LEN attribute is legal with CODED attribute.

Some of the illegal combinations are direct conflicts, such as UNIQUE and DEFERRABLE; others describe meaningless situations or unusable fields, such as ORDERED CHARACTER and ORDERED NUMERIC.

In addition, some attributes require other attributes. FLOAT, for example, requires a LENGTH specification.

Field descriptions that contain invalid combinations are rejected.

Combining attributes is for Entry Order files. More stringent restrictions are placed on fields that are used as sort keys, hash keys, or record security fields. These restrictions are summarized in the respective Commands and Parameters pages for each.

Field Naming

Field Worksheet