The Change Data Capture API
consists of functions, a system database, CDC records, and error codes.
Functions
Change Data Capture functions
are built-in SQL functions that you run by using the EXECUTE FUNCTION
statement. You use these functions to control data capture. The cdc_opensess() function returns the CDC session ID, which
is a smart large object file descriptor that you use to retrieve captured
data. The cdc_startcapture() function specifies
the table from which to capture data. Other functions specify to start
or end data capture.
You must call Change Data Capture functions
from a client application. You cannot call this function from a user-defined
routine that runs within the database server.
System database
The syscdc system database
contains the Change Data Capture functions and system tables. The system tables store information
about Change Data Capture API error codes and record types.
Error codes
The Change Data Capture API
functions return error codes. Most of the functions return an error
code both if they succeed or fail. The Change Data Capture API
error codes are listed in the syscdcerrcodes table of the syscdc database. You can query the syscdcerrcodes table
to determine whether the function failed and if so, why it failed.
Smart large object read functions
You use smart
large object read functions to read the captured data, by passing
the smart large object file descriptor provided by the cdc_opensess() function. Smart large object read functions are not part of the Change Data Capture API;
you can use smart large object read functions such as mi_lo_read() or ifx_lo_read().
CDC Records
The Change Data Capture (CDC)
records are returned by smart large object read functions and provide
information about the transaction currently being captured as well
as the actual captured data.