Text literals are strings that are enclosed in single quotation marks (') and are used to specify the values of strings in expressions, conditions, SQL functions, and SQL statements.
Text literals have the attributes of the CHAR and VARCHAR2 data types.
In expressions and conditions, ApsaraDB for OceanBase uses blank-padded comparison semantics for comparison and considers text literals as the
CHARdata type.When you specify text literals, a value of the
CHARdata type can be up to 2,000 bytes in length. A value of theVARCHAR2data type can be up to 32,767 bytes in length.
The following examples show some valid text literals. To show a single quotation mark (') in a string, you must insert a single quotation mark (') before the single quotation mark (') in the string.
'Jackie''s raincoat'
'Hello'
'09-MAR-98'
'It's a nice day today'