JOIN - Viva Clipper !
JOIN - Viva Clipper !
Viva Clipper !
JOIN
JOIN
Create a new database file by merging records/fields from two work areas
Syntax
Arguments
WITH <xcAlias> is the name of the work area to merge with records from the current work area. You can
specify it either as a literal alias or as a character expression enclosed in parentheses.
TO <xcDatabase> is the name of the target database file specified either as a literal filename or as a
character expression enclosed in parentheses.
FIELDS <idField list> is the projection of fields from both work areas into the new database file. To
specify any fields in the secondary work area, reference them with the alias. If the FIELDS clause is not
specified, all fields from the primary work area are included in the target database file.
Description
JOIN creates a new database file by merging selected records and fields from two work areas based on a
general condition. JOIN works by making a complete pass through the secondary work area for each
record in the primary work area, evaluating the condition for each record in the secondary work area.
When the <lCondition> is true (.T.), a new record is created in the target database file using the FIELDS
specified from both work areas.
https://vivaclipper.wordpress.com/2014/02/16/join/ 1/2
17/10/21 22:29 JOIN | Viva Clipper !
If SET DELETED is OFF, deleted records in both source files (i.e., the two files being JOINed) are
processed. However, their deleted status is not retained in the target <xcDatabase>. No record in the
target file is marked for deletion regardless of its deleted status in either of the source files.
If SET DELETED is ON, no deleted records are processed in either of the source files. Thus, deleted
records do not become part of the target <xcDatabase>. Similarly, filtered records are not processed and
do not become part of the target file.
Warning! The number of records processed will be the LASTREC() of the primary work area multiplied
by the LASTREC() of the secondary work area. For example, if you have two database files with 100
records each, the number of records JOIN processes is the equivalent of sequentially processing a single
database file of 10, 000 records. Therefore, use this command carefully.
Examples
Purchases.dbf:
Invoices->Amount
Seealso
SET RELATION
This entry was posted in Uncategorized and tagged SET RELATION. Bookmark the permalink.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
https://vivaclipper.wordpress.com/2014/02/16/join/ 2/2