Long Varchar Data Type
The long varchar data type has the same characteristics as the varchar data type, but can accommodate strings up to two GB in length. Do not declare a length for long varchar columns. In embedded SQL data handlers can be created, which are routines to read and write the data for long varchar (and long byte) columns. For details about data handlers, see Data Handlers for Large Objects in the “Embedded SQL” chapter, and the Embedded SQL Companion Guide.
Restrictions on Long Varchar Columns
The following restrictions apply to long varchar columns:
• They cannot be part of a table key.
• They do not declare a length.
• They cannot be part of a secondary index.
• They cannot be used in the order by or group by clause in a select statement.
• They cannot have query optimization statistics. For details about query optimization statistics, see the discussion of the optimizedb utility in the Command Reference Guide.
• The following string functions do not work with long varchar columns:
– Locate
– Pad
– Shift
– Squeeze
– Trim
– Notrim
– Charextract
• These columns cannot be directly compared to other string data types. To compare a long varchar column to another string data type, apply a coercion function.
• A string literal of more than 2000 characters cannot be assigned to a long varchar column. Details about assigning long strings to these columns are found in the description of data handlers in the Embedded SQL Companion Guide or the OpenAPI User Guide.
Last modified date: 08/14/2024