Microsoft KB Archive/92351

= Using the JOIN Command in FoxBASE+ =

PSS ID Number: 92351

Article Last Modified on 10/23/1999

-

The information in this article applies to:


 * Microsoft FoxBASE+ for MS-DOS 2.1

-



This article was previously published under Q92351



SUMMARY
The FoxBASE+ JOIN command creates a new database by combining two other databases. The JOIN combines the current database with another that is identified by its work area number or alias, designated by  or .

JOIN positions the record pointer on the first record in the current database and evaluates the FOR  expression for each record in the second database. If  evaluates to be true, JOIN writes a record into the new file. The process repeats for each record in the current database.



MORE INFORMATION
The syntax for the JOIN command is as follows: JOIN WITH  |  TO      FOR  FIELDS  | 

This parameter specifies the work area number , or the database alias .

TO

This parameter specifies the name of the newly created database.

FOR 

This parameter specifies the parameter to evaluate for each record. If  is true, JOIN writes a record in the new database.

FIELDS

This parameter specifies the fields to include in the records of the new database. The field list may include fields from both the current database and the second database. If no FIELDS clause is specified, records of the new database include all fields in the record in the active database, and as many fields from the second database that fit in the FoxBASE+ field limit.

The time required to execute a JOIN command may be very large depending on the sizes of the specified database files and on the <expL> expression. The JOIN command may also exhaust available disk space even when the databases have modest size.

The text below demonstrates joining the custno and invcno databases on the cno field: SELECT 1 USE customer INDEX custcno SELECT 2 USE invoice INDEX invcno SELECT 1 JOIN WITH invoice TO newfile FOR customer.cno=invoice.cno ; FIELDS customer.cno, customer.company, invoice.ino USE newfile DISPLAY STRUCTURE

Keywords: KB92351

Technology: kbAudDeveloper kbFoxBASE210DOS kbFoxBASESearch kbFoxproSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.