The BCD data type

<< Click to Display Table of Contents >>

Navigation:  Tables > Data table formats > Numerics, NULLs >

The BCD data type

Previous pageReturn to chapter overviewNext page

The BCD data type

The BCD (Binary Coded Decimal) data type is available in the Paradox table format but not in the dBASE/FoxPro table formats.

With the Borland Paradox 7 application and the DBD7 on Paradox tables there is no entry field for defining Scale and Precision for BCD fields. However, the Size field creating/restructuring BCD fields evaluates as the Precision parameter and the Scale defaults to 32.

BCD in Paradox

The BCD data type is available in the Paradox table format version 5 and 7 and is by SQL defined as DECIMAL(s,p), where s is Scale and p is Precision translating into the size of the BCD field (defaults to 32) and the available number of decimals.
In Paradox the BCD fields are provided primarily for the compatibility with other databases using this data type.

Creating the BCD fields for Paradox tables using the SQL DECIMAL(s,p) "s" (Scale) specifies the size of the field and "p" (Precision) the field's allowed maximum number of decimals. The SQL maximum allowed value for the Scale is 20 and maximum for Precision formally is 4 but technically the limit is 31.
However, the BDE with Paradox even accepts DECIMAL(20,32) translating into BCD(32,32) - though this will give erroneous inputs mis evaluating entered values and definitely should be avoided!
The PdxEditor SQL prevents these BCD dimensions by the it's custom SQL syntax check.
Number of integer digits are 32 minus the p-value - i.e. 32 for DECIMAL(32,0) and 1 for DECIMAL(32,31).
In practice, the precision limits to 4 decimals truncating (not rounding!) any decimals to the right of the 4 th decimal.

BCD in dBASE

Though the dBASE format does not have the storage BCD field type, there is an option of on the fly translating numeric types used for floating point numbers (NUMERIC and FLOAT) into BCD values, which displayed in a data grid are indistinguishable from the normal numeric types, but in customized applications may be beneficial for some kinds of numeric calculations, when not just using this data type as displayed.

If using BDE Alias databases of the dBASE type the BDE setting may be set via the BDE Administrator to BCD ENABLED = TRUE in case operated by specialized customized database applications needing this type of float to BCD translation as it's default.
For most databases however, the setting should be BCD ENABLED = FALSE.

In applications, where data input/output is via the data grid or by importing/exporting data, the BCD translation is irrelevant and so is irrelevant in an application like the PdxEditor.

__________________________
PdxEditor Application Help, 18 May 2026; © 2010-2026 Niels Knabe