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 */ assign service = new DataAdminService(LDBNAME(1)) policy = service:GetPartitionPolicy("RPolicy"). /* add a new detail and mark as splitTarget */ detail = service:NewPartitionPolicyDetail("MyPolicy-A"). policy:Details:Add(detail). detail:SetValue("A"). detail:IsSplitTarget=true. /* add a new detail and mark as splitTarget */ detail = service:NewPartitionPolicyDetail("MyPolicy-B"). policy:Details:Add(detail). detail:SetValue("B"). detail:IsSplitTarget=true. /* commit the new details */ service:UpdatePartitionPolicy(policy). /* 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). service:ExecuteUtility(split). catch e as Progress.Lang.Error: errorHandler = new DataAdminErrorHandler(). errorHandler:Error(e). end catch. finally: delete object service no-error. end finally. |