> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IBM Db2 LUW relation source

> Observe one Db2 LUW table over a dedicated TLS DRDA listener.

Bind `db2Relation("inventory", "db2.example:50001", login, data)`
to the SQL app's `provider` in the [SQL mount](https://docs.bijection.com/integrations/native-sql.md#mount-and-bind).
Pass the same label to the receiver binder and as the app's `data`.

Enable a direct Db2 LUW TLS listener with a certificate trusted by the installation.
Use a UTF-8 database with byte-based character declarations.
Use a database account with catalog visibility, SELECT on the table and
EXECUTE on one already bound DRDA dynamic query package. The profile expects
SQLAM 7 or later, UTF-8 result CCSIDs, password security mechanism 3 inside
TLS, and the Db2 LUW compact SQL result layout. Seal the endpoint-specific
credential with `bijection secret set`. Use the database and package names
from the server. Supply the eight-byte package consistency token as sixteen
hexadecimal digits and an available dynamic section in that package.

```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{
  "username": "inventory_reader",
  "password": "<Db2 password>",
  "database": "INVENTORY",
  "schema": "WAREHOUSE",
  "table": "ITEMS",
  "queryPackage": {
    "collection": "NULLID",
    "name": "SYSSH200",
    "token": "5359534c564c3031",
    "section": 1
  },
  "key": [{"column": "SITE_ID", "kind": "bigint"}, {"column": "ITEM_ID", "kind": "bigint"}],
  "columns": ["ITEM_ID", "DESCRIPTION", "QUANTITY"],
  "incarnation": "inventory-items-1"
}
```

Use exact catalog spelling. Maintain the complete unique, non-null tuple of
one to eight SMALLINT, INTEGER or BIGINT columns. The cursor retains the
tuple as exact decimal strings in a JSON array of up to 512 bytes. Project up
to sixteen integer or bounded CHAR or VARCHAR columns. Values land as UTF-8
strings or null with a 240-byte cell limit.

Catalog reads and the ordered page use Db2 Repeatable Read in one unit of
work. A page publishes up to 32 rows and 48 KiB of encoded observations and
position. Catalog identity or incarnation changes require a reset. Rotate
the sealed incarnation when you restore, replace or repoint the source.
Separate pages can see different commits. Traversals refresh observed keys
and retain keys that disappear.

Db2 SQL Replication identifies complete units of work. Its
`CD_OLD_SYNCHPOINT` reports retention-limit pruning. Normal pruning follows
SQL Apply acknowledgements, so a reader also needs a durable account of that
pruning before it can safely resume from its own retained position.

[Db2 catalog identity](https://www.ibm.com/docs/en/db2-warehouse?topic=views-syscattables) ·
[Db2 SQL Replication capture](https://www.ibm.com/docs/en/idr/11.4.0?topic=sr-capture-data-from-db2-sources-in-sql-replication) ·
[Db2 CD and UOW table pruning](https://www.ibm.com/docs/en/idr/11.4.0?topic=tables-cd-uow-table-pruning)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.