DB2 SQLCODE -805 signals that the requested package or DBRM cannot be found or is invalid at run time, halting statement execution.
DB2 SQLCODE -805 occurs when the database cannot locate or execute the required package or DBRM for your SQL statement. Re-bind or re-catalog the missing package with the correct consistency token, then commit and retry the query to resolve the error.
SQLCODE=-805, SQLSTATE=51002: DBRM or package name "location.collection.package(contoken)" not found in plan or collection-name.
The -805 error means Db2 failed to locate or execute the application package (DBRM) needed for your SQL at run time. The SQL engine stops the current statement and returns SQLSTATE 51002.The package name in the message pinpoints the location, collection, member and consistency token Db2 expected. When any element is missing or mismatched, execution cannot proceed.
Package was never bound: Developers often compile a program but forget to run BIND, leaving no executable package for Db2 to load.Consistency-token mismatch: A new compile creates a different token than the one stored in the catalog, so the runtime token lookup fails.Collection or location changed: Moving code between subsystems without re-binding changes the location or collection name, breaking the reference.Package marked invalid: Changes to dependent objects (table, view, function) can invalidate an existing package until it is rebound.
Re-bind the missing package: Use the BIND PACKAGE command with the correct DBRM and collection to recreate the executable package.Match consistency token: Ensure the DBRM generated during the compile step is the one supplied to BIND so tokens align.Verify COLLECTION and LOCATION: Bind into the collection referenced by your application plan or CURRENT PACKAGESET special register.Invalidate cache and test: After binding, commit and rerun the failing SQL to confirm resolution.
Java JDBC in DDF: Set CURRENT PACKAGESET before the first SQL or bind the package into the default NULLID collection.Static COBOL program: Add automatic BIND to the deploy pipeline so each compile step is followed by a bind with the right OWNER.Data migration between LPARs: Use DSNTIAUL UNLOAD and DSNTIAUL BIND to move DBRMs and bind packages in the target subsystem.
Automate compile-bind: Integrate BIND into CI/CD so no package is forgotten.Use versioned collections: Store each release in a dedicated collection name to avoid token clashes.Monitor package invalidations: Query SYSIBM.SYSPACKAGE and alert on VALID='N' rows to trigger proactive rebinds.Leverage Galaxy: Galaxy’s fast editor and AI copilot flag missing package references during code review and can auto-generate the required BIND commands.
-818: Timestamp mismatch between DBRM and load module; recompile and relink.-519: Prepared statement references unopened cursor; open or re-prepare.-51002: Generic package not found; often companion to -805 when location name is blank.
Package not bound after program compile.Mismatched consistency token between DBRM and cataloged package.Collection or location name changed without re-binding.Package invalidated by ALTER TABLE or dropped dependency.Application searching wrong collection due to CURRENT PACKAGESET value.
SQLCODE -818: Timestamp mismatch; recompile and bind both load module and DBRM.SQLCODE -519: Prepared statement attempted execute before OPEN; correct cursor workflow.SQLCODE -51002: Generic package missing; usually indicates blank location in -805 message.
Read the -805 message. The element in parentheses is the consistency token. Combine it with location.collection.package to identify the missing or invalid package in SYSIBM.SYSPACKAGE.
No. The SQL engine requires a valid executable package. Temporary workarounds like dynamic SQL may help, but the permanent fix is to bind or rebind the package.
Rebinding is online and instantaneous. Perform it in a maintenance window if you must preserve package access lists or plan dependencies.
Galaxy flags missing packages during query linting, suggests BIND syntax, and stores endorsed fix scripts in shared Collections so your team can reuse them.