To meet your needs, we constantly work to improve Querix products.
This means that Lycia documentation is developing as well.
In case you have found a certain dissonance between the provided information and the actual behavior of Lycia 3 and/or your applications, please, let us know about this via documentation@querix.com so that we can introduce the necessary changes to our documentation.
Thank you for your attention and cooperation.
CHAR data type stores a character string, the length of that string is limited by the maximum size specified when the data type is declared: CHAR (size). The character string can consist of printable characters and whitespaces.
CHARACTER is a synonym for CHAR.
The minimum size of the CHAR value is 1 byte; it is also the default maximum size of a CHAR variable which is applied if no size is defined explicitly. The maximum size that can be assigned to a CHAR value is 65,534 bytes. A variable defined as CHAR(53) can contain 53 or fewer bytes, but it cannot contain more than 53 bytes.
The length of a form-only field of the CHAR type cannot be specified, its default size corresponds to the field length from the screen layout.
When a value is passed between 2 variables of the CHAR type or between a variable and a column, both of which are of CHAR type, the number of bytes defined by the size option is transferred. That means that if a value is shorter than the size declared, additional whitespaces will be added to its end to fit the declared size. If the value entered for a variable or a column is longer than the size declared, it will be truncated on the right.
Two CHAR variables can sometimes cause a comparison to fail because the empty spaces may be added to their ends. The number of empty spaces in them may differ because they have been declared with different sizes, though the visible characters are the same. You may use CLIPPED operator to solve this problem.
Every value of the CHAR data type has an ASCII 0 end-of-data character at the end of it. It often results in impossibility of subsequent data addition or retrieval to or from a CHAR database column. Use the CLIPPED operator to convert CHAR variables which have NULL values to empty strings.
CHAR variables can store any printable symbols including digits, but if you want to perform arithmetic operations on numbers, you should store these numbers in variables of numeric data types. The CHAR data type is generally compatible with number data types, but you might not be able to use them in some calculations.
There are situations when CHAR data type is preferable for storing number values. E.g. some postal codes can contain leading zeros, which are removed from values as insignificant, if they are stored as some of the numeric data types (INTEGER, SMALLINT). In such cases numbers should be stored as CHAR data type.
CHAR data type usually requires 1 byte per character so the size in bytes is equal to the size in characters, but in some East Asian locales a character may require more than one byte to be stored. Some white space characters can also occupy more than one byte.