Click or drag to resize

DbJoin Function

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

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION DbJoin(
	 cAlias AS USUAL,
	 cTargetFile AS USUAL,
	 acFields AS USUAL,
	 cbForCondition AS USUAL
) AS LOGIC
View Source

Parameters

cAlias
Type: Usual
The alias identifier for the work area to join with.  If there is no open database associated with <cAlias>, a runtime error is raised.
cTargetFile
Type: Usual
The name of the target database file, including an optional drive, directory, and extension.  See SetDefault() and SetPath() for file searching and creation rules.  The default extension for database files is determined by the RDD (see the "RDD Specifics" appendix in the Programmer's Guide for details on a particular RDD).
If <cTargetFile> does not exist, it is created.  If it exists, this function attempts to open the file in exclusive mode and, if successful, the file is overwritten without warning or error.  If access is denied because, for example, another process is using the file, NetErr() is set to TRUE.  Refer to the "Concurrency Control" chapter in the Programmer's Guide for more information on resolving concurrency conflicts.
acFields
Type: Usual
The projection of fields from both work areas into the new database file.  To specify fields in the secondary work area, reference them with the alias operator (->).  If <acFields> is not specified, all fields from the source database file are included in the target database file.
cbForCondition
Type: Usual
A code block that defines a condition that each record within the scope must meet in order to be processed.

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
DBJoin() is the functional equivalent of the JOIN command.
Examples
The following example demonstrates DBJoin():
X#
USE joinme
IF Used()
        DBJoin("test2", "merge.dbf")
ENDIF
See Also