Skip to content

ORA-24338 when OUT REF CURSOR is not set #886

@jdaley

Description

@jdaley

I have a regression after upgrading oracledb from 1.13.1 to 2.1.2, for executing PL/SQL procedures with an OUT REF CURSOR that does not get set.

Example PL/SQL procedure:

procedure testproc(status out varchar2, lines out sys_refcursor)
is
begin
  -- ...code which may or may not set the 'lines' cursor...
  status := 'new';
end testproc;

Example JS:

const result = await connection.execute(
    "BEGIN testpkg.testproc(:0, :1); END;",
    [
        { dir: oracledb.BIND_OUT, type: oracledb.STRING },
        { dir: oracledb.BIND_OUT, type: oracledb.CURSOR }
    ]
);

In version 1.13.1, this returns a result with outBinds: [ 'new', null ]

In version 2.1.2, this throws ORA-24338: statement handle not executed

The version 1 behaviour is preferred because a null out cursor is not necessarily an error (at least, in this database) and it allows you to still read the values of other out parameters.


Node.js version: v8.10.0 (linux x64)
Node-oracledb version: 2.1.2
Oracle Client library version: 11.2.0.2.0
Oracle Database version: 11.2.0.2.0
Ubuntu 16.04 in Docker
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions