0% found this document useful (0 votes)
58 views2 pages

JOIN - Viva Clipper !

The JOIN command in Clipper merges records from two work areas into a new database based on a condition. It makes a pass through the secondary work area for each primary record, creating a new record in the target database if the condition is true. Fields from both work areas can be included. JOIN is useful for combining related data but must be used carefully as it processes all record combinations which can result in a large number of records.

Uploaded by

Jose Cordero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views2 pages

JOIN - Viva Clipper !

The JOIN command in Clipper merges records from two work areas into a new database based on a condition. It makes a pass through the secondary work area for each primary record, creating a new record in the target database if the condition is true. Fields from both work areas can be included. JOIN is useful for combining related data but must be used carefully as it processes all record combinations which can result in a large number of records.

Uploaded by

Jose Cordero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

17/10/21 22:29 JOIN | Viva Clipper !

Viva Clipper !

Notes of a Clipper Language Student

JOIN

Posted on February 16, 2014 by vivaclipper

JOIN

Create a new database file by merging records/fields from two work areas

Syntax

JOIN WITH <xcAlias> TO <xcDatabase>

FOR <lCondition> [FIELDS <idField list>]

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.

FOR <lCondition> selects only records meeting the specified condition.

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

. This example joins Customer.dbf to Invoices.dbf to produce

Purchases.dbf:

USE Invoices NEW

USE Customers NEW

JOIN WITH Invoices TO Purchases;

FOR Last = Invoices->Last;

FIELDS First, Last, Invoices->Number, ;

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.

Create a free website or blog at WordPress.com.

https://vivaclipper.wordpress.com/2014/02/16/join/ 2/2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy