Caché supports two maximum string length options:
The traditional maximum string length of 32,767 characters.
Long Strings maximum string length of 3,641,144 characters.
Long strings are enabled by default. If long strings are enabled, the maximum length of a string is 3,641,144 characters. If long strings are disabled, the maximum length of a string is 32,767 characters.
Attempting to exceed the current maximum string length results in a <MAXSTRING> error.
You can return the current system-wide maximum string length by invoking the MaxLocalLength()
method, as follows:
You can use any of the following operations to enable or disable long strings system-wide:
When a process actually uses a long string, the memory for the string comes from the operating system’s malloc() buffer, not from the partition memory space for the process. Thus the memory allocated for actual long string values is not subject to the limit set by the maximum memory per process (Maximum per Process Memory (KB)
) parameter and does not affect the $STORAGE
value for the process.