Function DbImport() Foundation
Imports data from a file into a work area.
DbImport( <cFilename>, ;
[<aFieldnames>], ;
[<bForCondition>], ;
[<bWhileCondition>], ;
[<nCount>], ;
[<xRecordID>], ;
[<lRest>], ;
[<cDbeName>], ;
[<aDbeInfo>] ) --> NIL
The return value of DbImport() is always NIL.
The function DbImport() imports records from a file <cFilename> into a work area. If the function is called without the alias operator, data is imported into the current work area. The file format of the source file and the database engine (DBE) used to manage it can be specified by the argument <cDbeName>. This allows file formats to be converted. If the source file <cFilename> has a file format different than the file open in the work area, the corresponding DBE must already be loaded under the name <cDbeName>. Loading database engines is done using the function DbeLoad().
The number of fields (columns) to be imported can be limited by specifying field names in the array <aFieldnames>. The number of records to be imported can also be limited. This is done by specifying conditions or by explicitly specifying the number of data records to import. When SET DELETED is set to ON, records with a deletion flag are not imported. If this switch is set to OFF, data records are imported from the source file even if they have a deletion flag.
If the file containing the data to import has a different format, the corresponding database engine (DBE) must be loaded and the name <cDbeName> of the this DBE must be specified. When the DBE allows it, the import format can be modified in certain ways by the configuration of the DBE. That applies to the DBEs SDFDBE (System Data Format) and DELDBE (Delimited Format). A two dimensional array containing information for the configuration can be passed as the parameter <aDbeInfo>. Only the DATA components of a DBE can be configured. The values from <aDbeInfo> are passed to the function DbeInfo(). After the data imported, the configuration of the DBE is reset to what it was prior to the call to DbImport().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.