Sunday, November 16, 2008

NUMERIC Datatype in ORACLE

BINARY_INTEGER Subtypes:
A base type is the datatype from which a subtype is derived.For your convenience, PL/SQL predefines the following BINARY_INTEGER subtypes:
NATURAL : let you restrict an integer variable to non-negative values.
NATURALN : let you restrict an integer variable to positive values.
POSITIVE : prevent the assigning of nulls to an integer variable.
POSITIVEN : prevent the assigning of nulls to an integer variable.
SIGNTYPE : lets you restrict an integer variable to the values -1, 0, and 1.

BINARY_FLOAT and BINARY_DOUBLE Datatypes:
To help deal with overflow, underflow, and other conditions that can occur with these numbers, you can use several special predefined constants: BINARY_FLOAT_NAN, BINARY_FLOAT_INFINITY, BINARY_FLOAT_MAX_NORMAL, BINARY_FLOAT_MIN_NORMAL, BINARY_FLOAT_MAX_SUBNORMAL, BINARY_FLOAT_MIN_SUBNORMAL, and corresponding names starting with BINARY_DOUBLE. The constants for NaN (not a number) and infinity are also defined by SQL;the others are PL/SQL-only.

NUMBER Datatype:
The syntax of a NUMBER datatype is:
NUMBER[(precision,scale)]
The maximum precision that can be specified for a NUMBER value is 38 decimal digits. If you do not specify precision, it defaults to 39 or 40, or the maximum supported by your system, whichever is less.

PLS_INTEGER Datatype:
You use the PLS_INTEGER datatype to store signed integers. Its magnitude range is -2147483648 to 2147483647, represented in 32 bits. PLS_INTEGER values require less storage than NUMBER values and NUMBER subtypes. Also, PLS_INTEGER operations use hardware arithmetic, so they are faster than NUMBER operations, which use library
arithmetic.

No comments:

search engine

Custom Search