Rename method: Tree class
Syntax
Rename(FromSetId, FromUserKeyValue, FromTreeName, FromEffDt, FromBranchName, ToTreeName)
Description
The Rename method renames a tree specified with the From parameters to the tree specified with ToTreeName. The tree specified by ToTreeName 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 executing the method.
The Rename method can be used only with a closed tree, it cannot be used on an open tree. Before you use the Rename 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. |
|
ToTreeName |
Specify the new name of the tree. This parameter takes a string value. |
Returns
An integer: 0 if renamed successfully.
Example
&MYTREE.Rename("","","PERSONAL_DATA3", "05-05-1997","", "PERSONAL_REN2");