Command APPEND FROM Foundation
Imports records from a file into the current work area.
APPEND FROM <cFilename> ;
[FIELDS <cFieldname,...>] ;
[FOR <lForCondition>] ;
[WHILE <lWhileCondition>] ;
[NEXT <nCount>] ;
[RECORD <xRecordID>] ;
[ALL] ;
[VIA <cDbe> | SDF | DELIMITED [WITH <cDelimiter>] ]
The file command APPEND FROM imports records from a file into the current work area. The format of the source file can differ from the format of the target file open in the work area. This allows data translation between different file formats to occur. The source file must be capable of being opened by a database engine (DBE) for APPEND FROM to be successfully executed.
The options VIA, SDF and DELIMITED determine which DBE is used to open and manage the source file <cFilename>. If SDF is specified, the source file is opened by the SDFDBE and the file must be an ASCII file containing data in the "System Data Format." If DELIMITED is specified, the source file is opened by the DELDBE. In this case, <cFilename>must be an ASCII file in the "Delimited Format." If VIA <cDbe> is specified, any database engine capable of managing the specific file format can be specified. The DBE does not need to be loaded prior to calling APPEND FROM. If it is not loaded, it is automatically loaded into memory and deleted from memory after termination of the command.
If no database engine is specified, the source file is opened using the current DBE. If the source file has a different file format, the corresponding DBE capable of opening the source file must be specified. Copying data from the source file into the work area (target file) occurs based on matching field names and/or equal data types. It should be noted that different DBEs can support different data types. In the case of the DELDBE, field names are predefined (FIELD1, FIELD2 to FIELDn). The option DELIMITED, therefore, uses only the data type of the fields and not the field names.
Generally, only fields of the same data type are imported into the work area with APPEND FROM. When the source file and the target file have a different file format (meaning they are managed by two different DBEs), the data types which can be stored in both file formats must be considered. Available file formats and data types are predetermined by the database engines managing the source file and target files. The specification of file formats for different DBEs is found in the chapter "The Xbase++ DatabaseEngine"in the Xbase++ documentation.
Specifying FOR, WHILE, RECORD or NEXT limits the number of records imported. These options are related to the source file and test data records in the source file. If the source file permits the logical deletion of records, records marked for deletion are only imported when SET DELETED is set to OFF. The records keep their deletion flag.
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.