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.6
	cAlias AS USUAL := NIL,
	cTargetFile AS USUAL := NIL,
	acFields AS USUAL := NIL,
	cbForCondition AS USUAL := NIL
Request Example View Source


cAlias (Optional)
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 (Optional)
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 .
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.  
acFields (Optional)
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 (Optional)
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.
DBJoin() is the functional equivalent of the JOIN command.
The following example demonstrates DBJoin():
1USE joinme
2IF Used()
3    DBJoin("test2", "merge.dbf")
See Also