Error Status 1491 when invoking a SQL procedure or function.

Document ID : KB000052768
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

When invoking a SQL procedure or function, it fails with error:

DC172998 V1 DBKEY=        STATUS=1491   BIND SUBSCHEMA-->nnnnnnnn
DC173001 V1 APPLICATION ABORTED. SUBSCHEMA BIND FAILED; STATUS=1491

The error status 1491 indicates no DBNAME has been established before issuing a BIND RUN UNIT.

If a DBNAME has already been set what else can cause this error?

Solution:

This is caused by specifying the option DEFAULT DATABASE NULL in the CREATE PROCEDURE or CREATE FUNCTION statement that was used to define the routine. This needs to be changed to DEFAULT DATABASE CURRENT. This option will allow any databases sessions started by the SQL procedure or function to inherit the currently set DBNAME.