Skip Headers

Oracle® Database Lite SQL Reference Release 10.3 Part Number E12092-02 |
Home | Book List | Contents | Index | Contact Us

Previous | Next
| View PDF

# D Oracle Database Lite Literals

Oracle Lite supports the following literals:

- Section D.1, "CHAR, VARCHAR"

- Section D.2, "DATE"

- Section D.3, "DECIMAL, NUMERIC, NUMBER"

- Section D.4, "REAL, FLOAT, DOUBLE PRECISION"

- Section D.5, "SMALLINT, INTEGER, BIGINT, TINYINT"

- Section D.6, "TIME"

- Section D.7, "TIMESTAMP"

## D.1 CHAR, VARCHAR

Character string literal value.

Syntax

    '<letters>'

Keywords and Parameters

<letters> a sequence of zero or more printable characters excluding new-line.

Usage Notes

If a single quote is part of a literal, it must be preceded by another single quote (used as an escape character). The maximum length of a character literal is 1024.

Examples

    'a string'
    'a string containing a quote '''

## D.2 DATE

Date literal value.

Syntax

    [DATE] ' <year1 ><month1 ><day >' [SQL-92]
    { d ' <year1 ><month1 ><day >' [ODBC]
    --(* d ' <year1 ><month1 ><day >' *)-- [ODBC]
    ' <day ><month2 ><year2 >' [Oracle]
    ' <day ><month2 ><year1 >' [Oracle]
    ' <month1 ><day ><year2 >' [Oracle]
    ' <month1 ><day ><year1 >' [Oracle]

Keywords and Parameters

<year1> a four-digit number representing a year, for example, 1994.

<year2> a two-digit number representing the last two digits of a year.

<month1> a two-digit number between 01 and 12.

<month2> a three-letter initial of a month (this is not case-sensitive).

<day> a two-digit number between 01 and 31 (depending on the month).

Examples

    '1994-11-07' [SQL-92]
    { d '1994-11-07' }
    --(* d '1994-11-07' *)--
    DATE '10-23-94'
    '23-Nov-1994' [Oracle]
    '23-Nov-94'

## D.3 DECIMAL, NUMERIC, NUMBER

Decimal number literal value.

Syntax

    [+|- ]<digits>
    [+|- ]<digits>.[<digits>]
    [+|- ].<digits>

Keywords and Parameters

<digits> a sequence of one or more digits.

Examples

    54321
    -123.
    +456
    64591.645
    +.12345
    0.12345

## D.4 REAL, FLOAT, DOUBLE PRECISION

Floating point number literal value.

Syntax

    [+|- ]<digits ><exp >[+|- ]<digits >
    [+|- ]<digits >. [<digits >]<exp >[+|- ]<digits >
    [+|- ].<digits ><exp >[+|- ]<digits >

Keywords and Parameters

<digits> a sequence of one or more digits.

<exp>'E' or 'e'.

Examples

    +1.5e-7
    12E-5
    -.12345e+6789

## D.5 SMALLINT, INTEGER, BIGINT, TINYINT

[ODBC]

Integer literal value.

Syntax

    [+|- ]<digits>

Keywords and Parameters

<digits> a sequence of one or more digits.

Usage Notes

Let n be the number the literal represents.

For TINYINT, -128 <= n <= 127

For a SMALLINT, -32768 <= n <= 32767

For an INTEGER, -2^31 < n < 2^31

For a BIGINT, -10^19 < n < 10^19

Example

    12345

## D.6 TIME

Time literal value.

Syntax

[TIME]' <hour>:<minute>:<second>[.[<fractional_second>]]'

Keywords and Parameters

<hour> a two-digit number between 00 and 23.

<minute> a two-digit number between 00 and 59.

<second> a two-digit number between 00 and 59.

<fractional_second> a number containing up to 6 digits.

Examples

    '23:00:00'
    TIME '23:00:00.'
    TIME '23:01:59.134343'

## D.7 TIMESTAMP

Timestamp literal value.

Syntax

    TIMESTAMP ' <DATE_literal_value > <TIME_literal_value >'

Keywords and Parameters

<DATE_literal_value> a Date literal.

<TIME_literal_value> a Time literal.

Usage Notes

In a timestamp literal, there is exactly one space character between the Date literal and the Time literal.

Examples

    TIMESTAMP '1994-11-07 23:00:00'
    '94-06-01 12:02:00'
    Examples: CHAR (10)