1.1.6 NChar
An NChar is a fixed-length character field, with a length between 1 and 65,535. (This is the number of characters, not the byte length.)
NChar fields store alpha data of any codepage. For example, in a list, an NChar field may have Japanese in one row, and French in another row.
NChars are classified as unicode strings.
Depending on the database type, NChar may or may not treat trailing blanks as significant. If trailing blanks are not desired, an NVarChar field should be used.
Please review the general 1.1.1 Field Type Considerations.
Field Definition Rules
Rules for defining a Char field in the repository are:
Length |
NChars may be 1 to 65,535 in length. NChars have no decimals. |
Valid Keyboard Shift |
Blanks. |
Allowed Attributes |
AB, ASQN, CS, FE, LC, ND, RA, RB, RL, RLTB. |
Edit Mask |
Not allowed. |
Default |
*NULL |
Usage Rules
Partition Type |
|
Files |
NChars may only be used in RDMLX Files. NChars may be used as real or key fields. If used as keys, length must be no more than 2000 characters. |
Logical Views |
NChars may be used as key fields. If used as keys, length must be less than 2000 characters. |
Virtual Fields |
NChars may be used with Code Fragment Virtual Fields. |
Predetermined Join Fields |
NChars may be used for lookup predermined joined fields. |
RDML Commands |
DEF_HEAD, DEF_FOOT, DEF_BREAK, and DEF_LINE only support printing of RDML fields. Therefore, NChar fields need to be converted to Alpha to be used in reports. |
Built-In Functions |
When used in Built-In Functions, Chars are valid for arguments of type 'A'. |
Special Values |
*NULL, *NAVAIL |
Conversion |
Refer to Field Type Conversions. |
Platform Considerations
- Refer to Platform Considerations in 1.1.1 Field Type Considerations.
Tips & Techniques
- If there is no need to support multiple languages at execution time, use an Alpha field or a Char field.
- If you want trailing blanks to be significant, use an NVarChar field.
Also See