PLSQL

PL/SQL Numeric Data types and Subtypes

PL/SQL Numeric Data types and Subtypes

Below are the list of numeric data types and their sub types- 

  • PLS_INTEGER

This is the signed integer in the range of -2,147,483,648 to 2,147,483,647 that are represented in 32 bits.

  • BINARY_INTEGER

This is also signed integer in the range of -2,147,483,648 to 2,147,483,647 that are represented in 32 bits.

  • BINARY_FLOAT

This is the single precision IEEE 754- format floating-point number. 

  • BINARY_DOUBLE

This is the double precision IEEE 754- format floating-point number.

  • NUMBER (prec, scale)

It is said to be a fixed point or floating-point number which has an absolute value in the range 1E-130 to (but not including) 1.0E126. This number value can also be represented as 0.

  • DEC (prec, scale)

This is ANSI specific fixed-point type with the maximum precision of 38 decimal digits.

  • DECIMAL (prec, scale)

This is known to be an IBM specific fixed-point type with the maximum precision of 38 decimal digits.

  • NUMERIC (pre, secale)

This is the floating type with the maximum precision of 38 decimal digits.

  • DOUBLE PRECISION

This is also known to be an ANSI specific floating-point type with maximum precision of 126 binary digits (approximately 38 decimal digits).

  • FLOAT

FLOAT is known as both ANSI and IBM specific floating-point type that is having maximum precision of 126 binary digits. That can be approximately 38 decimal digits.

  • INT

It is an ANSI specific integer type that has a maximum precision of 38 decimal digits.

  • INTEGER

This data type is also both ANSI and also IBM specific integer type with maximum precision of 38 decimal digits.

  • SMALLINT

It is an ANSI and also IBM specific integer type with the maximum precision of 38 decimal digits.

  • REAL

It is the floating-point type with the maximum precision of 63 binary digits and then approximately 18 decimal digits.

The given below syntax is the valid declaration:

DECLARE 

num 1 INTEGER;

num 2 REAL;

num 3 DOUBLE PRECISION;

BEGIN

null;

END;

/

When we execute the above code is compiled and executed, we get following result:

PL/SQL procedure successfully completed.