block-level on error undo, throw
using Progress.Lang.Error from propath. using OpenEdge.DataAdmin.DataAdminService from propath. using OpenEdge.DataAdmin.Error.DataAdmin.ErrorHandler from propath. using OpenEdge.DataAdmin.IPartitionPolicy from propath. using OpenEdge.DataAdmin.IPartitionPolicyDetail from propath. using OpenEdge.DataAdmin.IPartition from propath. using OpenEdge.DataAdmin.ITable from propath. using OpenEdge.DataAdmin.Util.PartitionMergeUtility from propath. define variable service as DataAdminService no-undo. define variable errorHandler as DataAdminErrorHandler no-undo. define variable tbl as ITable no-undo. define variable merge as PartitionMergeUtility no-undo. define variable policy as IPartitionPolicy no-undo. define variable start as IPartitionPolicyDetail no-undo. define variable target as IPartitionPolicyDetail no-undo. /* Start a service for the sptp database */ service = new DataAdminService("spmerge"). /* Retrieve the table */ tbl = service:GetTable("order"). /* Retrieve the partition policy */ policy = service:GetPartitionPolicy("pol") start = policy:Details:Find("pol1"). target = policy:Details:Find("pol2"). /* Pass the start and target partitions to the utility for merging the start partition into the target partition */ merge = new PartitionMergeUtility(start, target). service:ExecuteUtility(merge). catch e as Progress.Lang.Error: errorHandler = new DataAdminErrorHandler(). errorHandler:Error(e). end catch. finally: delete object service no-error. end finally. |