dBASE IV/5 to 7 issues

<< Click to Display Table of Contents >>

Navigation:  Tables > Data table formats > dBASE >

dBASE IV/5 to 7 issues

Previous pageReturn to chapter overviewNext page

Transfer issues from dBASE IV/5 tables to dBASE 7 tables (or vice versa)

Tables created under the BDE Admin setting with dBASE 7 as the default level will be created as dBASE 7 tables using the Double and Long fields for float and integer values respectively.
dBASE5-7-transfer-issue

This may raise type mismatch issues when trying to transfer seemingly analogue data types from dBASE IV/5 to dBASE 7 tables, as the dBASE IV/5 uses the text based NUMERIC field type for numeric data, whatever float or integer values, and opposed to the Double and Long field types used, when creating dBASE 7 tables, raising the Type mismatch error (and seems to be one of those never corrected BDE issues).

The error is raised when trying to transfer numbers data from NUMERIC fields to the incompatible dBASE 7 Long and Double fields.
So, if you try to create a copy of a dBASE IV/5 table like of the dBASE 5 replica of the Employee from the BDE DBDemos database into a dBASE 7 table like this:

CREATE TABLE EmployeeDBF7
(
  EmpNo INTEGER         -> will materialize as dBASE 7 Long fields
, LastName VARCHAR(20)
, FirstName VARCHAR(15)
, PhoneExt VARCHAR(4)
, HireDate DATE
, Salary FLOAT          -> will materialize as dBASE 7 Double fields
);
 
INSERT INTO EmployeeDBF7
SELECT
  EmpNo
, LastName
, FirstName
, PhoneExt
, HireDate
, Salary
FROM EmployeeDBF5  /* < the dBASE 5 source table*/

you will be met by the Type mismatch error.

One solution is to stick to the (ancient) NUMERIC float field type (for Salary), when creating the dBASE 7 table using the SQL DECIMAL(s,p) field specification.

Another solution is to convert the field of concern into a compatible numeric format like:

INSERT INTO EmployeeDBF7
SELECT
  CAST(EmpNo AS INTEGER)
, LastName
, FirstName
, PhoneExt
CAST(HireDate AS DATE)
CAST(Salary AS FLOAT)
FROM EmployeeDBF5  /* < the dBASE 5 source table*/

__________________________
PdxEditor Application Help, 14 July 2026; © 2010-2026 Niels Knabe