Text literals are strings enclosed in single quotation marks (’ ’). They are used to specify string values in expressions, conditions, SQL functions, and SQL statements.
Text literals have attributes of the CHAR and VARCHAR2 data types.
In expressions and conditions, OceanBase Database takes text literals as the CHAR data type. If two values differ in length, OceanBase Database adds blanks to the end of the shorter value until the two values are equal in length before comparing the two values.
The maximum length of a text literal of the CHAR data type is 2,000, and that of the VARCHAR2 data type is 32,767.
The following examples are some valid text literals. To present a single quotation mark in a string, insert another single quotation mark before the single quotation mark in the string:
'Jackie''s raincoat'
'Hello'
'09-MAR-98'
'The weather is fine today'