Updated on 2025-12-09 GMT+08:00

Overview of String Processing Functions and Operators

The string processing functions and operators provided by DWS are used to obtain the string length as well as truncate, concatenate, convert, and compare data.

Before learning about the functions, you can learn about the concepts of bit, byte, and character.

  • A bit is the basic unit of data in computers, representing either 0 or 1 in binary. These values correspond to the on/off state of a circuit or the positive/negative polarity of a magnetized surface.
  • 1 byte = 8 bits. A byte the basic unit of data storage and transmission in computers.
  • A character is a human-readable text symbol, such as a letter, digit, and punctuation. The database character encoding determines how a character is converted into bytes. For details about the database character encoding, see CREATE DATABASE.

For example, in UTF-8 of DWS, an English character takes one byte, and a Chinese character takes three bytes. If a field is defined as VARCHAR(100), the maximum storage would be 100 characters x 3 bytes/character = 300 bytes. In GBK, a single Chinese character can take two bytes.

Application scenarios of string processing functions are as follows: