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.
VARCHAR data type is similar to the CHAR data type and is also used to store character strings. The size of the VARCHAR variable is limited by 65534 characters. You can declare the maximum size of a VARCHAR variable by using (size) parameter. A string stored in this variable can be shorter that the declared size, but it cannot be longer. If you do not specify the size explicitly, the default size will be used which is equal to 1.
The size parameter of VARCHAR data type indicates the storage that will be reserved in the system for the variable declared as a VARCHAR. The reserved VARCHAR declaration does not affect the behavior of the 4GL syntax, but it may affect the behavior of a database which contains a column declared as VARCHAR.
VARCHAR values are compared in the same way as CHAR values, spaces are added to the end of the shorter value until both values are equal in lengths. A VARCHAR value can be compared only with a CHAR, VARCHAR or STRING value. If a VARCHAR variable consists only of white spaces, the trim() function or the CLIPPED operator applied to it will change its value to NULL.
There are some other features that differentiate VARCHAR data type from the CHAR data type:
No trailing blank spaces are ever stripped of a VARCHAR variable or of a value entered into a database column of the VARCHAR data type, if they are entered by a user
No blank spaces are added to the end of the VARCHAR values to fit the declared size, if they are not added by the user explicitly, so there is no need to use the CLIPPED operator when working with this data type
Usually VARCHAR data type 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.