Function DbExport() Foundation
Exports data from a work area into a new file.
DbExport( <cFilename>, ; [<aFieldNames>], ; [<bForCondition>], ; [<bWhileCondition>], ; [<nCount>], ; [<xRecordID>], ; [<lRest>], ; [<cDbeName>], ; [<aDbeInfo>] ) --> NIL
The return value of DbExport() is always NIL.
The function DbExport() exports records from a work area into a file <cFilename>. A new file is created by the call to this function, and if a file exists with this name it is overwritten. The file format of the new file can be set by specifying the database engine (DBE) <cDbeName> which is to manage the new file. This allows file formats to be converted. If the new file has a different file format, the corresponding DBE must already be loaded under the name <cDbeName>. The function DbeLoad() is used to load database engines.
The number of fields (columns) to be exported can be limited by including only the desired field names in the array <aFieldnames>. Also the number of records exported can be limited. This can be done by specifying conditions or by explicitly defining the number of records to be exported. When SET DELETED is set to ON, records with a deletion flag are not exported. If this switch is set to OFF, records with a deletion flag are also exported. If the DBE for the export file supports deletion flag, the exported records maintain the deletion flag.
If the file into which data is exported should have a different format, a corresponding database engine (DBE) must be loaded and the name of the applicable DBE must be specified as <cDbeName>. When the DBE allows it, the export format can be modified in certain ways by the configuration of the DBE. This applies to the DBEs SDFDBE (System Data Format) and DELDBE (Delimited Format). In addition, the parameter <aDbeInfo> can be used to pass a two dimensional array containing information for the configuration. Only the DATA components of a DBE can be configured. The values from <aDbeInfo> are passed to the function DbeInfo(). After the data is exported, the configuration of the DBE is reset to what was current before the call to DbExport().
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.