Try OpenEdge Now
skip to main content
Internationalizing Applications
Using SQL : Using the SQL language : Unit of length when working with character strings

Unit of length when working with character strings

The string operators in OpenEdge SQL consider the unit of length to be the character count, not a byte count or a column count.
Consider the syntax of the OpenEdge SQL LEFT function:
LEFT ( character-string-expression , length )
LEFT evaluates character-string-expression and returns the leftmost length characters, whether single byte, double byte, or triple byte.
In the following expression, character-string-expression consists of a four characters: the first single byte, the second double byte, and the third and fourth single byte:
The preceding expression returns the following string, which consists of three characters, the second of which is double byte, for a total of four bytes: