Try OpenEdge Now
skip to main content
Programming Interfaces
Change Data Capture ABL references : API to generate Change Data Capture policy program
 

API to generate Change Data Capture policy program

The following sample code shows how to use API service to generate an ABL program for a CDC policy:
using OpenEdge.DataAdmin.ICdcTablePolicy from propath.

define variable service as OpenEdge.DataAdmin.DataAdminService no-undo.
define variable tablePolicy as ICdcTablePolicy no-undo.

service = new OpenEdge.DataAdmin.DataAdminService(ldbname(1)).
tablePolicy = service:GetCdcTablePolicy("customerinActive2").
tablePolicy:ExportAsProcedure("cdcpoliy.p").
The ExportAsProcedure( ) method takes the file path, where the policy is to be generated, as input parameter. Note that the CDC table policy must exist to generate the policy program. In this case, the CDC table policy is customerinActive2.