ORA-24338 statement handle not executed #68

Open
mikegolod opened this Issue Aug 1, 2013 · 4 comments

Projects

None yet

3 participants

@mikegolod

Environment: Arch Linux (within Virtual Box on Windows 7)
Node: v0.10.15
Instant client: 12.1.0.1.0 (fresh version)

After successful install of oracle node module i wrote a sample script with just one select from view (simple view, contains about 300 rows). When i tried to run that script using node got the following error:

[Error: ORA-24338: statement handle not executed]

When I 'select * from dual' or 'select * ... where rownum < 2', no errors arise

@kontrafiktion
Contributor

Could you please paste that script

@kontrafiktion
Contributor

Have you solved the problem?

@nickrussler

I got the same error, the connection seems to be successfull, since when i select form non existing tables it get an according error.

var oracle = require("oracle");

var connectData = { "hostname": "XYZ", "user": "XYZ", "password": "XYZ", "database": "XYZ" };

oracle.connect(connectData, function(err, connection) {
  connection.execute("select id from person", [], function(err, results) {
    if (err) {
      console.log(err);
    } else {
      console.log(results);
    }
  });


  connection.close(); // call this when you are done with the connection
});

which gives me:

[Error: ORA-24338: statement handle not executed
]

When i change "id" to something wrong or "person" to something wrong i also get according errors.

@nickrussler

The problem was that the connection was closed too early..

So this would work for my example:

var oracle = require("oracle");

var connectData = { "hostname": "XYZ", "user": "XYZ", "password": "XYZ", "database": "XYZ" };

oracle.connect(connectData, function(err, connection) {
  connection.execute("select id from person", [], function(err, results) {
    if (err) {
      console.log(err);
    } else {
      console.log(results);
    }

    connection.close(); // call this when you are done with the connection
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment