Progress
Embedded SQL-92
Guide and Reference
NUMERIC or DECIMAL Data Type
The NUMERIC data type, which is the same as the DECIMAL data type, corresponds to a number with a given precision and scale. The database representation and the host language representation for the NUMERIC type is the following C Language structure:
The dec_num field in the structure contains the number of valid bytes in the dec_digits array. The most significant bit of the first byte of dec_digits[ 0 ] contains the sign bit: 1 for positive and 0 for negative.
The least significant 7 bits of dec_digits[ 0 ] contain the exponent in excess-64 format. The rest of the bytes in the dec_digits array contain the base-100 digits of the number value, with two digits in each byte. You can use SQL-92 functions to manipulate the number values in this format.
The range of values of a NUMERIC type column is -n to n, where n is the largest number that can be represented with the specified precision and scale.
EXAMPLEThe following example shows how to use a NUMERIC type:
In an application program, you can use the tpe_num_t structure to access the NUMERIC database type.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |