Pervasive PSQL and Embarcadero Data Types
This section details data type mappings.
Pervasive PSQL and Embarcadero Data Type Mappings
The following table shows data type mappings from Pervasive PSQL column types to Delphi data types. Types on the left stored in Pervasive PSQL databases will be exposed by PDAC components as the types listed on the right
The following table shows data type mapping from Delphi to Pervasive PSQL data types. When new database tables are created using PDAC, columns defined as the field types listed in the left hand column will be stored by Pervasive PSQL using the types listed on the right.
Btrieve and Embarcadero Data Type Mappings
The following table shows data type mapping from Btrieve to VCL.
*Note: Binary flags refer to a flag in X$Fields.Xe$Flags
 
The following table shows data type mapping from VCL to Btrieve.
*Note: Binary flags refer to a flag in X$Fields.Xe$Flags
Additional Field Type Information
There is a Pervasive-specific table create method (TPvTable.PvCreateTable) that allows you to tune additional parameters related to field types. It has the following definition:
Procedure PvCreateTable(PvFieldDefs: TPvFieldDefs)
In PvFieldDefs you can adjust several parameters:
TPvFieldDef = class(TCollectionItem)
public
FieldNum: integer;
BtrType: integer;
DrmType: word;
ColumnSize: integer;
DefaultValue: string;
IsColumnCaseInsensitive: boolean;
ACS_FileName: string;
ACS_Name: string;
ACS_ID: string;
end;
Where:
If you do not want to set a particular field, it can be set to 0 (DrmType, ColumnSize), -1 (BtrType), false (IsColumnCaseInsensitive) or ‘’ (all string fields). In this case, default values will be used. Field ‘FieldNum’ is required.
Fields ‘IsColumnCaseInsensitive’, ‘ACS_FileName’, ‘ACS_Name’, ‘ACS_ID’ are mutually exclusive. That is, you can set only one of them.
To match Btrieve behavior, index option ‘ixCaseInsensitive’ is ignored.
The following is an example of using the PvCreateTable method:
with PvTable1.FieldDefs do
begin
Clear;
Add('F_AutoInc', ftAutoInc, 0, true);
Add('F_Bytes', ftBytes, 10, False);
end;
 
PvFieldDefs := TPvFieldDefs.Create(TPvFieldDef);
try
PvFieldDef := PvFieldDefs.Add();
PvFieldDef.FieldNum := 1; // F_Bytes
PvFieldDef.BtrType := 10;
PvFieldDef.DrmType := DRM_coltypVarText;
PvFieldDef.ColumnSize := 20;
PvFieldDef.IsColumnCaseInsensitive := true;
 
PvTable1.PvCreateTable(PvFieldDefs);
finally
PvFieldDefs.Free();
end;