Numeric Data Compatibility

Numeric data compatibility differences exist between Sybase IQ and Adaptive Server Enterprise and SQL Anywhere.

  • In embedded SQL, fetch TINYINT columns into 2-byte or 4-byte integer columns. Also, to send a TINYINT value to a database, the C variable should be an integer.

  • Adaptive Server Enterprise 12.5.x versions do not support unsigned integers. You can map Sybase IQ unsigned integers to Adaptive Server Enterprise signed integers or numeric data, and the data are converted implicitly.
    • Map IQ UNSIGNED SMALLINT data to ASE INT

    • If you have negative values, map IQ UNSIGNED BIGINT to ASE NUMERIC (precision, scale)

      To avoid performance issues for cross-database joins on UNSIGNED BIGINT columns, the best approach is to cast to a (signed) BIGINT on the Sybase IQ side.

  • You should avoid default precision and scale settings for NUMERIC and DECIMAL data types, as these differ by product:

    Database

    Default precision

    Default scale

    Sybase IQ

    126

    38

    Adaptive Server Enterprise

    18

    0

    SQL Anywhere

    30

    6

  • The FLOAT) data type is a synonym for REAL or DOUBLE, depending on the value of p. For Adaptive Server Enterprise, REAL is used for p less than or equal to 15, and DOUBLE for p greater than 15. For Sybase IQ, the cutoff is platform-dependent, but on all platforms, the cutoff value is greater than 22.

  • Sybase IQ includes two user-defined data types, MONEY and SMALLMONEY, which are implemented as NUMERIC(19,4) and NUMERIC(10,4) respectively. They are provided primarily for compatibility with Adaptive Server Enterprise.