Syntax

 

<signed numeric literal> ::= [ + | - ] <unsigned numeric literal>

 

<unsigned numeric literal> ::=

 

<exact numeric literal> ::=

 

<unsigned integer> ::= <digit>...

 

<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

 

<approximate numeric literal> ::= <mantissa> E <exponent>

 

<mantissa> ::= <exact numeric literal>

 

<exponent> ::= <signed integer>

 

<signed integer> ::= [ + | - ] <unsigned integer>

 

 

Notes

 

An exact numeric literal without a decimal fraction specified denotes an integer value. The implicit data type is BIGINT.



 

An exact numeric literal with a decimal fraction specified denotes a BCD value. The implicit data type is DECIMAL.



 

The number of digits following the decimal point is determining the implicit scale of an exact numeric literal. If the specified scale exceeds the maximum scale of 4, then the value is truncated to scale 4.



 

 

Examples

 

Data Type

 

Literal Examples

 

SHORTINT

96

SMALLINT

5247

INTEGER

258476

BIGINT

2147483648

NUMERIC

14.99

15.

DECIMAL

14.99

15.

FLOAT

1.56E-4

200E10

REAL

1.56E-4

DOUBLE PRECISION

3.1415929265432E00

EXTENDED

3.1415929265432E00

 

 


 

Conformance

 

SQL:2003 standard

-

Core SQL