TINYINT
  • The TINYINT data type stores an 8-bit unsigned integer. The minimum value is 0. The maximum value is 255.
  • SMALLINT
    The SMALLINT data type stores a 16-bit signed integer. The minimum value is -32,768. The maximum value is 32,767.
  • INTEGER
    The INTEGER data type stores a 32-bit signed integer. The minimum value is -2,147,483,648. The maximum value is 2,147,483,647.
  • BIGINT
    The BIGINT data type stores a 64-bit signed integer. The minimum value is -9,223,372,036,854,775,808. The maximum value is 9,223,372,036,854,775,807.
  • DECIMAL(precision, scale) or DEC(p,s)
    DECIMAL(p, s) is the SQL standard notation for fixed-point decimal. “p” specifies precision or the number of total digits (the sum of whole digits and fractional digits). “s” denotes scale or the number of fractional digits. If a column is defined as DECIMAL(5, 4) for example, the numbers 3.14, 3.1415, 3.141592 are stored in the column as 3.1400, 3.1415, 3.1415, retaining the specified precision(5) and scale(4).
    Precision p, can range from 1 to 38. The scale can range from 0 to p. If the scale is not specified, it defaults to 0.
    If precision and scale are not specified, DECIMAL becomes a floating-point decimal number. In this case, precision and scale can vary within the range 1 to 34 for precision and -6,111 to 6,176 for scale, depending on the stored value.
    Examples: 0.0000001234 (1234E-10) has precision 4 and scale 10. 1.0000001234 (10000001234E-10) has precision 11 and scale 10. 1234000000 (1234E6) has precision 4 and scale -6.
  • SMALLDECIMAL
    The SMALLDECIMAL is a floating-point decimal number. The precision and scale can vary within the range 1~16 for precision and -369~368 for scale, depending on the stored value. SMALLDECIMAL is only supported on column store.
    DECIMAL and SMALLDECIMAL are floating-point types. For instance, a decimal column can store any of 3.14, 3.1415, 3.141592 whilst maintaining their precision.
    DECIMAL(p, s) is the SQL standard notation for fixed-point decimal. 3.14, 3.1415, 3.141592 are stored in a decimal(5, 4) column as 3.1400, 3.1415, 3.1415 for example, retaining the specified precision(5) and scale(4).
  • REAL
    The REAL data type specifies a single-precision 32-bit floating-point number.
  • DOUBLE
    The DOUBLE data type specifies a single-precision 64-bit floating-point number. The minimum value is -1.7976931348623157E308 and the maximum value is 1.7976931348623157E308 . The smallest positiveDOUBLE value is 2.2250738585072014E-308 and the largest negative DOUBLE value is -2.2250738585072014E-308.
    REAL and DOUBLE types are stored in the system using binary numbers. The fractional part of these numbers is represented using a combination of 1/2, 1/4, 1/8, 1/16, and so on. For this reason they cannot completely represent rational numbers with fractional digits. 0.1 for example cannot be represented exactly by combining these binary fractions. In this case, you will obtain inaccurate results when using the DOUBLE or REAL type. This is not an issue with the SAP HANA database. It is the correct behavior for these data types. For a demonstration of this property in action, please see the example below.
     SELECT TO_DOUBLE(0.1) + TO_DOUBLE(4.6) AS DOUBLE_SUM FROM DUMMY;
    
     DOUBLE_SUM
     4.6999999999
    
  • FLOAT(n)
    The FLOAT(n) data type specifies a 32-bit or 64-bit real number, where n specifies the number of significant bits and can range between 1 and 53.
    If you use the FLOAT(n) data type, and n is smaller than 25, the 32-bit REAL data type is used instead. If n is greater than or equal to 25, or if n is not declared, the 64-bit DOUBLE data type is used.


    Serkan AKKAVAK
    Computer Engineer
    ABAP Developer & SAP S/4 HANA Logistics Team Lead
    Contact : serkurumsal@yandex.com