String Literals

String literals appear as a part of expressions.

String literals are also sometimes called character literals or text literals. When a string literal appears as part of an expression in this documentation, it is indicated by the word TEXT. The syntax for for both single-line and multi-line string literals is:

'character_string'

In all cases, character_string is a combination of alphabetic characters, numeric characters, punctuation marks, spaces, and tabs. In addition:

Note: Double quotation marks used to delimit a string are used for object names and not string literals. Object names cannot be multiple lines long or contain newline (NL) characters or double quotation marks within the string.

To include a single quotation mark (or an apostrophe) in a string delimited by single quotation marks, enter a backslash before the quotation mark ( \' ) for the inside quotation marks. For example:

'And that\'s the truth.'

To include a single quotation mark (or an apostrophe) in a string literal (delimited by single quotation marks), enter a backslash before the quotation mark or apostrophe you want to include in the string: ( \' ). For example:

'He said "No!"'

Some examples of valid string literals are:

'abc123'
'abc 123'
'It\'s a good idea.'
'"What?" he asked.'

Internationalization impacts string literals. All the literals in the preceding list are 7-bit ASCII literals. But this is also a literal:

'αβγ123'