Record Header Attributes

The SQL Server CDC Client origin generates JDBC record header attributes that provide the SQL Server CDC data for each record, such as the start or end log sequence numbers (LSN).

The origin also includes the sdc.operation.type attribute and information from the SQL Server CDC tables. The SQL Server CDC Client header attributes are prefixed with jdbc. The names of the SQL Server CDC column names are included in the header attribute name, as follows: jdbc.<CDC column name>.

You can use the record:attribute or record:attributeOrDefault functions to access the information in the attributes. For more information about working with record header attributes, see Working with Header Attributes.

The origin provides the following header attributes:
Header Attribute Name Description
sdc.operation.type
The origin uses the following values to represent the operation type:
  • 1 for Insert
  • 2 for Delete
  • 3 for Update, including updates captured after the update operation
  • 5 for unsupported operations, including updates captured before the update operation
jdbc.cdc.source_schema_name Provides the source schema for the CDC data.
jdbc.cdc.source_name Provides the source table for the CDC data.
jdbc.tables
Provides a comma-separated list of source tables for the fields in the record.
Note: Not all JDBC drivers provide this information.
jdbc.<column name>.jdbcType Provides the numeric value of the original SQL data type for each field in the record. See the Java documentation for a list of the data types that correspond to numeric values.

Because the record read from the SQL Server CDC table includes CDC columns, the generated record also includes corresponding jdbc.<column name>.jdbcType header attributes for those columns.

For example, since the original data includes a __$start_lsn column, the resulting record has a jdbc.__$start_lsn.jdbc.Type header attribute. It also has a jdbc.__$start_lsn attribute that is generated separately by the origin, as described below.

jdbc.<column name>.jdbc.precision Provides the original precision for all numeric and decimal fields.
jdbc.<column name>.jdbc.scale Provides the original scale for all numeric and decimal fields.
jdbc. __$command_id Data from the SQL Server CDC __$command_id column.
jdbc.__$end_lsn Data from the SQL Server CDC __$end_lsn column.
jdbc.__$operation The CRUD operation type using SQL Server codes, as defined in the SQL Server CDC __$operation column.
jdbc.__$seqval Data from the SQL Server CDC __$seqval column.
jdbc.__$start_lsn Data from the SQL Server CDC __$start_lsn column.
jdbc.__$update_mask Data from the SQL Server CDC __$update_mask column.

For details about the CDC attributes, see the SQL Server documentation.