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.21
Syntax FUNCTION DbJoin(
cAlias,
cTargetFile,
acFields,
cbForCondition,
lNoOpt
) AS LOGIC CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static bool DbJoin(
Usual cAlias = default,
Usual cTargetFile = default,
Usual acFields = default,
Usual cbForCondition = default,
Usual lNoOpt = default
)
Request Example
View SourceParameters
- 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.
- lNoOpt (Optional)
- Type: Usual
Return Value
Type:
Logic
TRUE if successful; otherwise, FALSE.
Remarks
DBJoin() is the functional equivalent of the JOIN command.
Examples
The following example demonstrates DBJoin():
1USE joinme
2IF Used()
3 DBJoin("test2", "merge.dbf")
4ENDIF
See Also