Copy method: Tree class

Syntax

Copy(FromSetId, FromUserKeyValue, FromTreeName, FromEffDt, FromBranchName, ToSetId, ToUserKeyValue, ToTreeName, ToEffDt, ToBranchName)

Description

The Copy method copies from the tree identified by the From parameters and copies it to the tree identified with the To parameters. The tree specified by the To parameters must be a new tree. You receive an error if the tree already exists. The tree specified by the From parameters does not have to match the tree identifier executing the method.

The Copy method can be used only with a closed tree, it cannot be used on an open tree. Before you use the Copy method, you must explicitly close any open tree objects (with the Close method.) You receive an error if there are any open trees.

To access the new tree, you must use the Open method.

Parameters

Parameter Description

FromSetId

Specify the table indirection key for the tree to be copied from. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "S", you must specify a SetID.

If the tree structure doesn’t have its IndirectionMethod specified as "S", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

FromUserKeyValue

Specify the User Key Value for the tree to be copied from. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "U" or "B", you must specify a User Key Value.

If the tree structure doesn’t have its IndirectionMethod specified as "U" or "B", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

FromTreeName

Specify the name for the tree to be copied from. This parameter takes a string value.

FromEffDt

Specify the effective date for the tree to be copied from. This parameter takes a string value.

FromBranchName

This parameter is required, but it is unused in this release. You must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

ToSetId

Specify the table indirection key for the tree to be copied to. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "S", you must specify a SetID.

If the tree structure doesn’t have its IndirectionMethod specified as "S", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

ToUserKeyValue

Specify the User Key Value for the tree to be copied to. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "U" or "B", you must specify a User Key Value.

If the tree structure doesn’t have its IndirectionMethod specified as "U" or "B" you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

ToTreeName

Specify the name for the tree to be copied to. This parameter takes a string value.

ToEffDt

Specify the effective date for the tree to be copied to. This parameter takes a string value.

ToBranchName

This parameter is required, but it is unused in this release. You must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

Returns

An integer: 0 if copied successfully.

Example

&MYTREE.Copy("","","PERSONAL_DATA", "05-05-1997", "", "","","PERSONAL_EDIT1", "05-⇒
05-1997", "");