The expanded parameters of literal represent specific data values in an SQL statement.
Expansion of literal
►►─┬─ 'character-string-literal' ──────────────┬──────────────────────────────►◄ ├─ G'double-byte-character-string-literal' ─┤ ├─ X'hexadecimal-literal' ──────────────────┤ ├─ exact-numeric-literal ───────────────────┤ └─ approximate-numeric-literal ─────────────┘
Represents a character value as a string of single-byte characters (for example, '79 High Street').
A character string literal can consist of any combination of letters, digits, and special characters (including blanks). Lowercase letters are not equal to uppercase letters in a character string literal (for example, 'Boston' is not equal to 'BOSTON').
Character string literals must be enclosed in single quotation marks. To include a single quotation mark as part of the character string itself, code two consecutive single quotation marks (for example, 'Carol''s job').
Represents a character value as a string of double-byte characters. Within a double-byte character string literal, a sequence of one or more double-byte characters must be preceded by the shift-out character and followed by the shift-in character (for example, G'<####>', where < and > represent the shift-out and shift-in characters and # represents a double-byte character). The shift characters are not part of the data value.
A double-byte character string literal can consist of any combination of characters in the double-byte character set (including the double-byte blank character). The entire sequence of characters, including the shift-out and shift-in characters, must be enclosed in single quotation marks.
Note: Certain hardware configurations do not require the use of shift characters in double-byte character string literals.
Note: 'SQL Standard Compatibility'. Double-byte character string literals are a CA IDMS extension of the SQL standard.
Represents a binary value as a sequence of an even number of hexadecimal digits (for example, X'01F27A'). Hexadecimal literals must be enclosed in single quotation marks.
Case is not significant in hexadecimal literals. You can use either uppercase or lowercase for the digits A through F.
Represents a signed or unsigned fixed-point decimal number. The decimal point in an exact numeric literal can be either explicit (for example, 39523.142) or implicit after the rightmost digit (for example, -2834).
Represents a floating point number. Approximate numeric literals have the form mantissaEexponent (for example, 3.45E-2), where:
Specifying Values for a New Row
The INSERT statement below inserts a new row into the COVERAGE table. The values in the row are represented by the following types of literals: character string (first column), exact numeric (second and fourth columns), and date (third column).
insert into coverage (plan_code, emp_id, selection_date, num_dependents)
values ('002', 2538, '1989-05-11', 3);
|
Copyright © 2014 CA.
All rights reserved.
|
|