Home  >  Article  >  Database  >  What is the length of number in oracle

What is the length of number in oracle

下次还敢
下次还敢Original
2024-05-02 23:33:59623browse

The Oracle NUMBER data type has a maximum length of 38 bits, including the decimal point and decimal places: 38 bits for the integer part and 128 bits for the fractional part. Precision is the number of digits that can be stored after the decimal point and ranges from 0 to 128. When choosing the appropriate length, consider data range, accuracy requirements, and storage space.

What is the length of number in oracle

The length of the NUMBER data type in Oracle

The NUMBER data type is used to store numeric values ​​in the Oracle database Common data type. Its length can vary depending on the size and precision requirements of the data.

Maximum length

The maximum length of the NUMBER data type is 38 bits, including the decimal point and decimal places:

  • 38-bit integer part
  • 128 decimal places

Precision and range

Precision refers to the number of digits that can be stored after the decimal point. The number of decimal places can range from 0 to 128.

The NUMBER data type supports the following range:

  • Maximum value: 99999999999999999999999999999999999999999999999999.99
  • Minimum value: -99999999999999999 999999999999999999999999999999999999.99

Precision Example

  • NUMBER(10,2): Can store a number with up to 8 digits for the integer part and 2 digits for the decimal part after the decimal point.
  • NUMBER(18,0): Can store up to 18-digit integer part, no decimal part.

Choose the appropriate length

When choosing the appropriate length for the NUMBER data type, you should consider the following factors:

  • Data range: Whether the data value may exceed the maximum or minimum value.
  • Precision requirements: How many decimal places need to be stored.
  • Storage space: The longer the data type, the greater the storage space.

Note:

  • The length of the NUMBER(p,s) data type is p s 1, where p is the number of integer digits and s is the decimal number number of digits.
  • NUMBER data types support variable length, which means they can only take up as much space as they need.
  • For very large numbers, you can use the BINARY_DOUBLE data type, which can store a larger range of numeric values.

The above is the detailed content of What is the length of number in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn