Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>append from</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
APPEND FROM


Syntax:     APPEND [<scope>] [FIELDS <field list>] FROM
            <file>/(<expC1>) [FOR <condition>] [WHILE <condition>]
            [SDF]/[DELIMITED [WITH BLANK/<delimiter>/(<expC2>)]]

Purpose:    To add records to the current database file from an ASCII
            text file or another database file.

Argument:   <file> is the name of the source file.  If no type
            option is specified, (.dbf) is the default file type and no
            extension is necessary.  If there is a type option
            specified, the file extension is assumed to be (.txt) unless
            specified.

Options:    Fields: If the FIELDS clause is specified, data is
            APPENDed only into the fields specified.

            Scope: The <scope> is the portion of the source database
            file to APPEND FROM.  NEXT <n> APPENDS the first <n>
            records.  RECORD <n> APPENDs only the source database file
            record number <n> to the target database file.  The default
            scope is ALL.

            Condition: The FOR clause specifies the conditional set
            of records to APPEND FROM within the given scope.  The WHILE
            clause specifies the set of records meeting the condition
            from the first record in the source file until the condition
            fails.

            Type: There are three types of files Clipper can
            import:  SDF, DELIMITED, and (.dbf) files.

            SDF identifies a System Data Format ASCII file.  Each record
            is a fixed length, ends with a carriage return and line
            feed, and the end-of-file mark is Ctrl-Z (1A hex).

            DELIMITED identifies an ASCII text file, where fields are
            separated by commas and character fields are bounded by
            double quote marks (the default delimiter).  Note that the
            delimiters are not required and Clipper correctly APPENDs
            character fields not bounded by them.  Fields and records
            are variable length and end with a carriage return and line
            feed.  The end-of-file mark is Ctrl-Z (1A hex).

            DELIMITED WITH BLANK identifies an ASCII text file, where
            fields are separated by one space and character fields are
            not bounded by delimiters.

            DELIMITED WITH <delimiter> identifies a delimited ASCII text
            file, where character fields are delimited with the
            specified delimiter.

Usage:      Deleted records in the source database file are APPENDed as
            deleted in the target database file.  If DELETED is ON,
            however, none of the deleted source records are APPENDed.

            Fields with the same names and types are APPENDed.  The
            source and target fields must be the same data type.  If
            they are not, a Miscellaneous runtime error is generated
            with a "Type mismatch" info message when the APPEND FROM
            statement executes.

            Matching widths: If a target field is larger, Clipper
            pads the source data to fill it.  If the target field is
            smaller, Clipper truncates the source data.

Network:    Note that APPEND FROM does not require the target file
            locked with FLOCK() or USEed EXCLUSIVEly in order to
            function properly.  Clipper automatically arbitrates
            contention for the target database file during APPENDs.

Library:    CLIPPER.LIB


----------------------------------- Example --------------------------------

   The following APPENDs FROM using a fields list:

   USE Sales
   APPEND FIELDS Branch, Salesman, Amount;
      FROM Branch;
      FOR Branch = 100

   This example demonstrates using <scope> to specify a record:

   APPEND RECORD 5 FROM Temp


See Also: COPY

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson