Delete method: Tree class

Syntax

Delete(SetID, UserKeyValue, TreeName, EffDt, BranchName)

Description

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

The specified tree does not have to match the tree identifier executing the method.

Parameters

Parameter Description

SetID

Specify the table indirection key for the tree. 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.

UserKeyValue

Specify the User Key Value for the tree. 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.

TreeName

Specify the name for this tree. This parameter takes a string value.

EffDt

Specify the effective date for this tree. This parameter takes a string value.

BranchName

Specify the name of the branch for the tree. This parameter takes a string value. If the tree is unbranched, 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 deleted successfully.

Example

&MYTREE=&Session.GetTree();

If ALL(&MYTREE) Then
   &RETVALUE = &MYTREE.Delete("","","PERSONAL_REN2", "05-05-1997", "");
End-If;