Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : ABL API for Multi-tenant and Table Partition Management : Executing DataAdminService utilities : PartitionSplitUtility class : Split from an allocated partition detail
Split from an allocated partition detail
A partition detail that has already moved to an allocated partition can be re-allocated to other partitions. That is, you can move data from an allocated partition to one or more new partitions.
The following sample code shows how to split from an allocated partition:
using OpenEdge.DataAdmin.DataAdminService from propath.
using OpenEdge.DataAdmin.Error.DataAdminErrorHandler from propath.
using OpenEdge.DataAdmin.ITable from propath.
using OpenEdge.DataAdmin.Util.PartitionSplitUtility from propath.
using OpenEdge.DataAdmin.IPartitionPolicy from propath.
using OpenEdge.DataAdmin.IPartitionPolicyDetail from propath.

define variable service as DataAdminService no-undo.
define variable policy as IPartitionPolicy no-undo.
define variable detail as IPartitionPolicyDetail no-undo.
define variable errorhandler as DataAdminErrorHandler no-undo.
define variable split as PartitionSplitUtility no-undo.

/* Retrieve the partition policy */
service = new DataAdminService(LDBNAME(1))
policy = service:GetPartitionPolicy("RPolicy").

/* add a new detail and mark as splitTarget */
detail = service:NewPartitionPolicyDetail("MyPolicy-A").

/* add a new detail and mark as splitTarget */
detail = service:NewPartitionPolicyDetail("MyPolicy-B").

/* commit the new details */
/* Run PartitionSplitUtility to split the detail that currently has the data
for the new details (all values with A, B and C) */
detail = policy:Details:Find("MyPolicy-C").
split = new PartitionSplitUtility(detail).

catch e as Progress.Lang.Error:
errorHandler = new DataAdminErrorHandler().
end catch.

delete object service no-error.
end finally.
Two new partition details, MyPolicy-A and MyPolicy-B, are created. Using PartionSplitUtility, data from the allocated partition detail, MyPolicy-C, is moved to the new partition details.