Show TOC

Background documentationLiteral (literal) Locate this document in the navigation structure

 

A literal (literal) is an unnamed data object that is defined fully by virtue of its value (specifies a non-NULL value). Literal values cannot be modified. A distinction is made between numeric literals and string literals.

Structure

Syntax Syntax

  1. <literal> ::=
      <numeric_literal>
    | <string_literal>
    
    <numeric_literal> ::=
      <fixed_point_literal>
    | <floating_point_literal>
    
    <string_literal> ::=
      ''
    | '<character>...'
    | <hex_literal>
    
End of the code.

Example Example

Numeric literals

+0.58498

1E160

-765E-04

String literals

'69190 Walldorf'

'Anton Schmitt'

X'12ab'

End of the example.
Numeric Literal

A numeric literal (numeric_literal) represents a number as a fixed or floating point number (fixed_/floating_point_literal).

String Literal

A string literal (string_literal) is a sequence of characters contained within apostrophes.

An apostrophe within a character string is represented by two successive apostrophes.

A string literal of the type '<character>...' or '' is only valid for a value referring to an alphanumeric column with the code attribute ASCII.

A string literal of the type '', x'' and X'', and string literals that only contain blanks are not the same as the NULL value.

String literals can also be represented in hexadecimal notation by preceding them with x or X. A hex_literal hexadecimal value is only valid for a value referring to a column with the code attribute BYTE.

Syntax Syntax

  1. <hex_literal> ::=
      x''
    | X''
    | x'<hex_digit_seq>'
    | X'<hex_digit_seq>'
    
    <hex_digit_seq> ::=
      <hex_digit><hex_digit>
    | <hex_digit_seq><hex_digit><hex_digit>
    
    <hex_digit> ::=
      0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    | A | B | C | D | E | F
    | a | b | c | d | e | f
    
End of the code.