RDD

DbJoin()

Create a file by merging records from two work areas

Syntax

Signature
DbJoin( cAlias, cFile, [aFields], [bFor] ) --> lSuccess

Arguments

cAlias

Alias of the second work area. cFile Destination file.

aFields

Optional fields to copy. bFor Optional condition block.

Return value

.T. when the joined file is created successfully; otherwise .F..

Description

DbJoin() combines records from the current work area and the work area named by cAlias, writing matching combinations to a new database file.

Notes

Both source areas must be open. The current selection remains available afterward.

Example

DbJoin.prg
PROCEDURE Main()

   DbUseArea( .T., , "people.dbf", "People" )
   DbUseArea( .T., , "cities.dbf", "Cities" )
   QOut( "Joined: " + IIF( DbJoin( "Cities", "joined.dbf" ), "YES", "NO" ) )
   DbCloseAll()
   FErase( "joined.dbf" )

   RETURN

Output

See also