Giter Site home page Giter Site logo

node-db-oracle's Introduction

db-oracle: Oracle database bindings for Node.js

For detailed information about this and other Node.js database bindings visit the [Node.js db-mysql homepage] homepage.

INSTALL

OCI libraries

Before proceeding with installation, you need to have the [OCI instant client] oci [libraries] oci-lib and [include files] oci-inc. For example, you download the instantclient-basic-linux.x64-11.2.0.3.0.zip library file, and the instantclient-sdk-linux.x64-11.2.0.3.0.zip SDK file, and save them in your $HOME/Downloads directory. You would then uncompress both files, and move the generated directory to your /opt path:

$ cd $HOME/Downloads
$ unzip instantclient-basic-linux.x64-11.2.0.3.0.zip
$ unzip instantclient-sdk-linux.x64-11.2.0.3.0.zip 
$ sudo mv instantclient_11_2/ /opt/instantclient

After uncompressing you will probably need to create symbolink links:

$ cd /opt/instantclient
$ sudo ln -s libocci.so.11.1 libocci.so
$ sudo ln -s libclntsh.so.11.1 libclntsh.so

You will also need libaio. In Arch Linux this can easily be installed with:

$ sudo pacman -S libaio

On Debian based distros:

$ sudo apt-get install libaio

Configuring OCI

Once you have the library and include files installed, and in order for the installation script to locate them properly, you'll need to set the OCI_INCLUDE_DIR and OCI_LIB_DIR environment variables. For example:

$ export OCI_INCLUDE_DIR=/opt/instantclient/sdk/include/
$ export OCI_LIB_DIR=/opt/instantclient

Install

Once the environment variables are set, install with npm:

$ npm install db-oracle

You should also add the OCI library path to your LD_LIBRARY_PATH environment:

export LD_LIBRARY_PATH=/opt/instantclient

QUICK START

var oracle = require('db-oracle');
new oracle.Database({
    hostname: 'localhost',
    user: 'root',
    password: 'password',
    database: 'node'
}).connect(function(error) {
    if (error) {
        return console.log("CONNECTION ERROR: " + error);
    }

    this.query().select('*').from('users').execute(function(error, rows) {
        if (error) {
            return console.log('ERROR: ' + error);
        }
        console.log(rows.length + ' ROWS');
    });
});

LICENSE

This module is released under the [MIT License] license.

node-db-oracle's People

Contributors

mariano avatar tojocky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-db-oracle's Issues

Mountain Lion

Hi:

I've been trying to install this module without any success, the following lines are taken from config.log file:

[1/2] �[32mcxx: build/.conf_check_0/test.cpp -> build/.conf_check_0/testbuild/Release/test_1.o
�[0m['/usr/bin/g++', '-g', '-Wall', '-I/opt/instantclient/sdk/include', '../test.cpp', '-c', '-o', 'Release/test_1.o']
[2/2] �[33mcxx_link: build/.conf_check_0/testbuild/Release/test_1.o -> build/.conf_check_0/testbuild/Release/testprog
�[0mld: warning: ld: warning: ld: warning: ignoring file Release/test_1.o, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 1 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): Release/test_1.oignoring file /opt/instantclient/libocci.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/instantclient/libocci.dylibignoring file /opt/instantclient/libclntsh.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/instantclient/libclntsh.dylib

ld: warning: ignoring file /opt/instantclient/libnnz10.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/instantclient/libnnz10.dylib
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
['/usr/bin/g++', 'Release/test_1.o', '-o', '/Users/flaco/Sites/NodeApps/node_modules/db-oracle/build/.conf_check_0/testbuild/Release/testprog', '-arch', 'i386', '-L/opt/instantclient', '-locci', '-lclntsh', '-lnnz10']
command returned 'Build failed: -> task failed (err #1): \n\t{task: cxx_link test_1.o -> testprog}'Missing include files for OCI

Hoping someone here could help me :(

slow result sets

It seems anything beyond nominal result sets takes an extremely long time. The query below (500 rows of 3 columns) completes with ruby's activerecord in 1.4 seconds, while node takes about 34 seconds. If I limit the rows to 10, node it will run in .8 seconds. During the 34 seconds, node is not doing much, sitting idle barely hitting RAM or CPU.

I turned casting off to see if it would make a difference, it doesn't

    var startAt;
    server.query().execute('SELECT "ORDER_NO","CUSTOMER_PO_NO","PRIMARY_CONTACT" FROM SF_RH_CUST_HEADER WHERE ROWNUM <= 500',[],function(err,rows){
      console.log(rows);
    },{
        async:true, 
        cast:false, 
        finish:function(){
          console.log('seconds: ', (new Date()-startAt)/1000);
        },
        start:function(){
          console.log('start: ',startAt = new Date());
        }
      }
    );

UTF-8 Support Documentation

You should update your documentation to include instructions on UTF-8 support. Through some investigative work, Ryan Allen, a co-worker of mine, found that you must specify a value of "utf8" for both the "charset" and "ncharset" options. It only works if both options are set.

new oracle.Database({
    charset: 'utf8',
    ncharset: 'utf8',
    hostname: conf.get("oracleHostName"),
    port: conf.get("oraclePort"),
    user: conf.get("oracleUser"),
    password: conf.get("oraclePassword"),
    database: conf.get("oracleDatabase")
  }).connect(function(error) {
      // execute query
});

Error running on node 0.10 -- undefined symbol: ev_default_loop_ptr

I get the following error when I try to use db-oracle on node 0.10 (but don't get the error on node 0.8.22):

module.js:356
Module._extensions[extension](this, filename);
^
Error: .../node_modules/db-oracle/build/Release/oracle_bindings.node: undefined symbol: ev_default_loop_ptr
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (.../node_modules/db-oracle/db-oracle.js:18:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Docs

use code gates in docs

three back tics will open and close syntax highlighting...

var x = (function() { // foobar
   var y = [10, 20, 30, 'foo'];
}())

Cannot install on debian

Using latest oracle instantclient 11.2.0.3.0 x86 get the following error:

[1/2] [32mcxx: build/.conf_check_0/test.cpp -> build/.conf_check_0/testbuild/Release/test_1.o
[0m['/usr/bin/g++', '-g', '-Wall', '-I/opt/instantclient/sdk/include/', '../test.cpp', '-c', '-o', 'Release/test_1.o']
[2/2] [33mcxx_link: build/.conf_check_0/testbuild/Release/test_1.o -> build/.conf_check_0/testbuild/Release/testprog
[0m/usr/bin/ld: cannot find -locci
collect2: ld returned 1 exit status
['/usr/bin/g++', 'Release/test_1.o', '-o', '/var/claimweb/node-db-oracle/build/.conf_check_0/testbuild/Release/testprog', '-L/opt/instantclient', '-locci', '-lclntsh', '-lnnz11']
command returned 'Build failed:  -> task failed (err #1): \n\t{task: cxx_link test_1.o -> testprog}'Missing include files for OCI

Instantclient is located in /opt/instantclient

Symbol not found: _ev_default_loop_ptr

I get an error when trying to run a node.js application with db-oracle.

  Module._extensions[extension](this, filename);
                               ^
Error: dlopen(/Users/XX/Documents/Projects/XX/node_modules/db-oracle/build/Release/oracle_bindings.node, 1): Symbol not found: _ev_default_loop_ptr
  Referenced from: /Users/XX/Documents/Projects/XX/node_modules/db-oracle/build/Release/oracle_bindings.node
  Expected in: flat namespace
 in /Users/XX/Documents/Projects/XX/node_modules/db-oracle/build/Release/oracle_bindings.node
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/XX/Documents/Projects/XX/node_modules/db-oracle/db-oracle.js:20:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Process finished with exit code 8

I double checked all of my environment variables and installation. I'm on Mac OSX.
Thanks for any help

Segfaulting db-oracle

Hi there!

I'm compiling db-oracle against 11_2 oracle on linux mint with node 0.7.7-exp. Compiles ok via npm etc. but segfaults as soon as I run the sample program. No error.

I tried the tests.js and oracle-test.js files with the same result. oracle-test-async.js gave a slightly different problem:

node oracle-test-async.js

node.js:216
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/home/aprice/node_modules/db-oracle/build/oracle-test-async.js'
at Function._resolveFilename (module.js:334:15)
at Function._load (module.js:281:25)
at Array.0 (module.js:483:10)
at EventEmitter._tickCallback (node.js:207:41)

I really dunno what's happening here -- help much appreciated! Also been work with Joe trying to use his driver, so maybe I am just cursed/stupid :(

Andy

SELECT CLOB field Error

Help!

who can help me!

The same error as #30 #30

terminate called after throwing an instance of 'oracle::occi::SQLException'
what(): ORA-01460: unimplemented or unreasonable conversion requested

mac OS X Lion - unable to load shared library

Successfully installed db-oracle using node 0.6.5, after:

ln -s libclntsh.dylib.10.1 libclntsh.dylib
ln -s libocci.dylib.10.1 libocci.dylib
ln -s libnnz10.dylib libnnz11.dylib

In app.js I have one line:

var oracle = require('db-oracle');

When I run node app.js from /code/oracle_node, I get:

node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
          ^
Error: Unable to load shared library /code/oracle_node/node_modules/db-oracle/build/Release/oracle_bindings.node
at Object..node (module.js:463:11)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/code/oracle_node/node_modules/db-oracle/db-oracle.js:18:15)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)

Any ideas?

error: too few arguments to function ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*, eio_channel*)’

../lib/node-db/binding.cc: In static member function ‘static v8::Handlev8::Value node_db::Binding::Connect(const v8::Arguments&)’:
../lib/node-db/binding.cc:86:76: error: too few arguments to function ‘eio_req* eio_custom(void ()(eio_req), int, int ()(eio_req), void_, eio_channel_)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here
../lib/node-db/query.cc: In static member function ‘static v8::Handlev8::Value node_db::Query::Execute(const v8::Arguments&)’:
../lib/node-db/query.cc:646:76: error: too few arguments to function ‘eio_req* eio_custom(void ()(eio_req), int, int ()(eio_req), void_, eio_channel_)’
/usr/local/include/node/uv-private/eio.h:361:10: note: declared here

npm ERR! System Linux 2.6.38-11-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "db-oracle"
npm ERR! cwd /home/run/git/node
npm ERR! node -v v0.7.8-pre
npm ERR! npm -v 1.1.6
npm ERR! code ELIFECYCLE

Mountain Lion installing

i've been trying to get this module to compile with OSX 10.8.2 I've tried both the 11.2 and 10.2 oracle lib and for both 32 and 64 bit but keep getting the same error.
ld: warning: ignoring file /opt/instantclient//libnnz10.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /opt/instantclient//libnnz10.dylib
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386

not sure where to go on this one.

Problems with npm install db-oracle

The following command (npm install db-oracle) with Ubuntu triggers the bug:

npm http GET https://registry.npmjs.org/db-oracle
npm http 304 https://registry.npmjs.org/db-oracle

npm ERR! Unresolvable cycle detected
npm ERR! While installing: [email protected]
npm ERR! Found a pathological dependency case that npm cannot solve.
npm ERR! Please report this to the package author.
npm ERR!
npm ERR! System Linux 3.0.0-12-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "db-oracle"
npm ERR! cwd /home/ubuntu/proyectos/node-db-oracle
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.9
npm ERR! code ECYCLE
npm ERR! message Unresolvable cycle detected
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/proyectos/node-db-oracle/npm-debug.log
npm not ok

Any idea about the problem? Thanks in advanced

Unable to load shared library after compile (Ubuntu and Mac OS X)

I have been trying to get this library working for a while now. I've attempted on Node 0.4.x as well as 0.6.x with no success. I can get the module built, however trying to use it yields an error message stating it can't load the shared library. Any assistance would be greatly appreciated.

My /opt/instantclient directory structure:

# ls -lah /opt/instantclient/
total 169M
drwxr-xr-x 3 drudge drudge 4.0K Dec 28 17:51 .
drwxr-xr-x 3 drudge drudge 4.0K Dec 28 17:33 ..
-rw-r--r-- 1 drudge drudge  437 Dec 28 17:33 BASIC_README
-rwxr-xr-x 1 drudge drudge  22K Dec 28 17:33 adrci
-rwxr-xr-x 1 drudge drudge  38K Dec 28 17:33 genezi
lrwxrwxrwx 1 drudge drudge   17 Dec 28 17:51 libclntsh.so -> libclntsh.so.11.1
-rwxr-xr-x 1 drudge drudge  42M Dec 28 17:33 libclntsh.so.11.1
-r-xr-xr-x 1 drudge drudge 6.8M Dec 28 17:33 libnnz11.so
lrwxrwxrwx 1 drudge drudge   15 Dec 28 17:46 libocci.so -> libocci.so.11.1
-rwxr-xr-x 1 drudge drudge 1.8M Dec 28 17:33 libocci.so.11.1
-rwxr-xr-x 1 drudge drudge 113M Dec 28 17:33 libociei.so
-r-xr-xr-x 1 drudge drudge 149K Dec 28 17:33 libocijdbc11.so
-r--r--r-- 1 drudge drudge 2.0M Dec 28 17:33 ojdbc5.jar
-r--r--r-- 1 drudge drudge 2.6M Dec 28 17:33 ojdbc6.jar
drwxrwxr-x 4 drudge drudge 4.0K Sep 19 03:12 sdk
-rwxr-xr-x 1 drudge drudge 157K Dec 28 17:33 uidrvci
-rw-r--r-- 1 drudge drudge  66K Dec 28 17:33 xstreams.jar

Installation via npm:

# export OCI_LIB_DIR=/opt/instantclient
# export OCI_INCLUDE_DIR=/opt/instantclient/sdk/include/
# npm install db-oracle
npm http GET https://registry.npmjs.org/db-oracle
npm http 304 https://registry.npmjs.org/db-oracle

> [email protected] install /home/drudge/test/node_modules/db-oracle
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for header occi.h               : yes 
Checking for library occi                : yes 
'configure' finished successfully (0.492s)
Waf: Entering directory `/home/drudge/test/node_modules/db-oracle/build'
[ 1/12] cxx: lib/node-db/binding.cc -> build/Release/lib/node-db/binding_1.o
[ 2/12] cxx: lib/node-db/connection.cc -> build/Release/lib/node-db/connection_1.o
[ 3/12] cxx: lib/node-db/events.cc -> build/Release/lib/node-db/events_1.o
[ 4/12] cxx: lib/node-db/exception.cc -> build/Release/lib/node-db/exception_1.o
[ 5/12] cxx: lib/node-db/query.cc -> build/Release/lib/node-db/query_1.o
[ 6/12] cxx: lib/node-db/result.cc -> build/Release/lib/node-db/result_1.o
[ 7/12] cxx: src/connection.cc -> build/Release/src/connection_1.o
[ 8/12] cxx: src/oracle.cc -> build/Release/src/oracle_1.o
[ 9/12] cxx: src/query.cc -> build/Release/src/query_1.o
[10/12] cxx: src/result.cc -> build/Release/src/result_1.o
[11/12] cxx: src/oracle_bindings.cc -> build/Release/src/oracle_bindings_1.o
[12/12] cxx_link: build/Release/lib/node-db/binding_1.o build/Release/lib/node-db/connection_1.o build/Release/lib/node-db/events_1.o build/Release/lib/node-db/exception_1.o build/Release/lib/node-db/query_1.o build/Release/lib/node-db/result_1.o build/Release/src/connection_1.o build/Release/src/oracle_1.o build/Release/src/query_1.o build/Release/src/result_1.o build/Release/src/oracle_bindings_1.o -> build/Release/oracle_bindings.node
Waf: Leaving directory `/home/drudge/test/node_modules/db-oracle/build'
'build' finished successfully (4.173s)

My test code (test.js):

var oracle = require('db-oracle');
new oracle.Database({
    hostname: 'localhost',
    user: 'drudge',
    password: 'password',
    database: 'node'
}).connect(function(error) {
    if (error) {
        return console.log("CONNECTION ERROR: " + error);
    }

    this.query().select('*').from('users').execute(function(error, rows) {
        if (error) {
            return console.log('ERROR: ' + error);
        }
        console.log(rows.length + ' ROWS');
    });
});

And the error:

# node test.js 

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Unable to load shared library /home/drudge/test/node_modules/db-oracle/build/Release/oracle_bindings.node
    at Object..node (module.js:463:11)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous> (/home/drudge/test/node_modules/db-oracle/db-oracle.js:18:15)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)

Versions:

  • Ubuntu: 10.04 LTS (32-bit)
  • Node: 0.6.6
  • NPM: 1.1.0-beta-4
  • Oracle Instant Client & SDK: 11.2.0.3.0

db-oracle installation on ubuntu 11 and Oracle 11g R2

hi!

Pls I got this error when I ran npm db-oracle install

npm db-oracle install

node.js:63
throw e;
^
Error: Cannot find module '../lib/utils/log'
at loadModule (node.js:275:15)
at require (node.js:411:14)
at /home/amosun/bin/npm:3:11
at Object. (/home/amosun/bin/npm:65:2)
at Module._compile (node.js:462:23)
at Module._loadScriptSync (node.js:469:10)
at Module.loadSync (node.js:338:12)
at Object.runMain (node.js:522:24)
at Array. (node.js:756:12)
at EventEmitter._tickCallback (node.js:55:22)

I dont knwo if am missing a module, or something.

Thanks

Cant install on Ubuntu - Incompatible libocci.so

Hello,

Trying to oracle 11 on ubuntu 11.1. not sure what im doing wrong, the config.log says:

[1/2] ^[[32mcxx: build/.conf_check_0/test.cpp -> build/.conf_check_0/testbuild/Release/test_1.o
^[[0m['/usr/bin/g++', '-g', '-Wall', '-I/opt/instantclient/sdk/include/', '../test.cpp', '-c', '-o', 'Release/test_1.o']
[2/2] ^[[33mcxx_link: build/.conf_check_0/testbuild/Release/test_1.o -> build/.conf_check_0/testbuild/Release/testprog
^[[0m/usr/bin/ld: skipping incompatible /opt/instantclient/libocci.so when searching for -locci
/usr/bin/ld: cannot find -locci
/usr/bin/ld: skipping incompatible /opt/instantclient/libclntsh.so when searching for -lclntsh
/usr/bin/ld: cannot find -lclntsh
/usr/bin/ld: skipping incompatible /opt/instantclient/libnnz11.so when searching for -lnnz11
/usr/bin/ld: cannot find -lnnz11
collect2: ld returned 1 exit status

ORA-12154: TNS:could not resolve the connect identifier specified

Hello. I'm trying to connect to my database, but I always get same response:

$ node ora.js
WARNING: ev_ref is deprecated, use uv_ref
WARNING: ev_unref is deprecated, use uv_unref
Connection error: ORA-12154: TNS:could not resolve the connect identifier specified

The code is based on the example:

var or = require('db-oracle');
var connection_datas = {
    hostname: 'example-serv.org',
//    port: '1521',
    user: 'us',
    password: 'pw',
    database: 'des'
};
var o = new or.Database(connection_datas);

o.connect(function(error) {
    if (error) {
    return console.log('Connection error: ' + error);
    }

    this.query().select('*').from('dual').execute(function(error, rows) {
    if (error) return console.log('Error' + error);
    console.log(rows.length + ' rows.');
    console.log(rows);
    });
});

I don't know if des is database service name or is listener database name, so I've tried with service name too (databse: 'des.example-serv.org') but I've had same result.

I can't specify port because I get this error (uncommenting port line):

$ node ora.js

/home/aoramire/Desarrollo/tmp/ora.js:9
var o = new or.Database(connection_datas);
        ^
Error: Option "port" must be a valid UINT32
    at Object.<anonymous> (/home/aoramire/Desarrollo/tmp/ora.js:9:9)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Here is my env. vars.:

$ set | grep -E "ORA|OCI|TNS|LD_LIB"
LD_LIBRARY_PATH=:/var/lib/oracle/app/oracle/product/11.2.0/client_1/lib
OCI_INCLUDE_DIR=/var/lib/oracle/app/oracle/product/11.2.0/client_1/rdbms/public
OCI_LIB_DIR=/var/lib/oracle/app/oracle/product/11.2.0/client_1/lib
ORACLE_BASE=/var/lib/oracle
ORACLE_HOME=/var/lib/oracle/app/oracle/product/11.2.0/client_1
TNS_ADMIN=/var/lib/oracle/app/oracle/product/11.2.0/client_1/network/admin

My tnsnames.ora:

$ cat $TNS_ADMIN/tnsnames.ora
# tnsnames.ora Network Configuration File: /var/lib/oracle/app/oracle/product/11.2.0/client_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

DES =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = example-serv.org)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SERVICE_NAME = des.example-serv.org)
    )
  )

And, ping to database:

$ tnsping des

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 16-SEP-2012 08:51:37

Copyright (c) 1997, 2009, Oracle.  All rights reserved.

Used parameter files:
/var/lib/oracle/app/oracle/product/11.2.0/client_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = example-serv.org)(PORT = 1521))) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = des.example-serv.org)))
OK (360 msec)

What is the problem?
Thanks.

db-oracle installation problem with instant client 11.2.0.2

got Missing include files for OCI.
In config.log got next few lines:
--- cut ---
build/.conf_check_0/test.cpp -> build/.conf_check_0/testbuild/default/test_1.o
�[0m['/usr/bin/g++', '-g', '-Wall', '-I/usr/include/oracle/11.2/client', '../test.cpp', '-c', '-o', 'default/test_1.o']
[2/2] �[33mcxx_link: build/.conf_check_0/testbuild/default/test_1.o -> build/.conf_check_0/testbuild/default/testprog
�[0m/usr/bin/ld: warning: libnnz11.so, needed by /usr/lib/oracle/11.2/client/lib//libclntsh.so, not found (try using -rpath or -rpath-link)
/usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference to nztSetAppDefaultLocation' /usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference tonzos_DisableClientAuthentication'
/usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference to nzos_Create_Ctx' /usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference tonzgbllsm_location_shared_memory'
... 90 lines skipped
/usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference to nzos_setCertValPolicy' /usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference tonzssGSL_GetSecretLength'
/usr/lib/oracle/11.2/client/lib//libclntsh.so: undefined reference to `B_DigestFinal'
collect2: ld returned 1 exit status
['/usr/bin/g++', 'default/test_1.o', '-o', '/tmp/111/node-db-oracle/build/.conf_check_0/testbuild/default/testprog', '-L/usr/lib/oracle/11.2/client/lib/', '-locci', '-lclntsh']
command returned 'Build failed: -> task failed (err #1): \n\t{task: cxx_link test_1.o -> testprog}'Missing include files for OCI
--- cut ---

TNS Could not resolve the connect identifier specified

I keep getting a ORA-12154 when trying to connect.
I am trying to understand the params that are passed to the database connection.
I have a local oracle10g running on port 1522
so I supply
{
hostname:'localhost',
port:'1522',
user:'_',
password:'_
***'
}

In the example Database is specified, I am unsure what that would do in ORACLE since Oracle Schema's are per user.

Upgrade packaging to node-gyp

I have tried to upgrade so that this addon builds for windows using the updated packaging mechanisms but have failed miserably.

I think it would be great if this addon used the latest packing so that I could make a decent attetmpt at a windows build.

My attempt thus far fails wit the following error:

LINK : fatal error LNK1181: cannot open input file 'occi.obj' [C:\repo\node-db-oracle\build\binding.vcxproj]

Thats just fyi.

terminate called if 'select null from' executed

test.js:

var oracle = require('db-oracle');
new oracle.Database({
    hostname: 'host',
    user: 'user',
    password: 'password',
    database: 'oracle_service'
}).connect(function(error) {
    if (error) {
        return console.log("CONNECTION ERROR: " + error);
    }
    console.log("Connected");
    this.query().execute('select NULL N1 from dual',function(error, rows) {
        if (error) {
            return console.log('ERROR: ' + error);
        }
        console.log(rows);
        console.log(rows.length + ' ROWS');
    });
});

Got:

terminate called after throwing an instance of 'oracle::occi::SQLException'
  what():  ORA-32108: max column or parameter size not specified

terminate called after throwing an instance of 'node_db::Exception'

oracle table name:TEST_NODE_ORACLE

table filed:NUM number,NAME number(use varchar get the same error)

this.query("INSERT INTO TEST_NODE_ORACLE(NUM,NAME) VALUES(1,111)").execute(function(error,result){
if (error) {
return console.log("INSERT ERROR: " + error);
}
console.log("GENERATED ID: " + result);
});
when i run this script,get this:
terminate called after throwing an instance of 'node_db::Exception'
what(): Not implemented
how to do this?

execute query crash

When I executes a simple query,nodejs crashed.
this.query().select(' count(*) ').from('TB_DEPT').execute(function(error, rows) {
if (error) {
return console.log('ERROR: ' + error);
}
console.log(rows.length + ' ROWS');
});

*** glibc detected *** ./node: free(): invalid pointer: 0x0000000001e5f720 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3a8f27245f]
/lib64/libc.so.6(cfree+0x4b)[0x3a8f2728bb]
/usr/lib64/libstdc++.so.6(_ZNSsD1Ev+0x3a)[0x3a95a9dbca]
/opt/node_modules/db-oracle/build/default/oracle_bindings.node(_ZN14node_db_oracle6Result3rowEPm+0x6d2)[0x2ad1c302a41e]
/opt/node_modules/db-oracle/build/default/oracle_bindings.node(_ZN14node_db_oracle6ResultC1EPN6oracle4occi9StatementE+0x69f)[0x2ad1c302b131]
/opt/node_modules/db-oracle/build/default/oracle_bindings.node(_ZNK14node_db_oracle10Connection5queryERKSs+0x52)[0x2ad1c3026ca6]
/opt/node_modules/db-oracle/build/default/oracle_bindings.node(_ZNK7node_db5Query7executeEv+0x47)[0x2ad1c301403d]
/opt/node_modules/db-oracle/build/default/oracle_bindings.node(_ZN7node_db5Query10eioExecuteEP7eio_req+0x86)[0x2ad1c3019cee]
./node[0x533f0b]
/lib64/libpthread.so.0[0x3a8fe0673d]
/lib64/libc.so.6(clone+0x6d)[0x3a8f2d40cd]

Missing include files for OCI

Hi
I'm trying to use node-db-oracle but it's not easy T.T
this is the message for my error

node-waf configure build --verbose
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : ok /home/sigyun/Downloads/node_modules
Checking for node prefix : ok /usr/local
Checking for header occi.h : 22:08:34 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-I/opt/instantclient/sdk/include/', '../test.cpp', '-c', '-o', 'Release/test_1.o']
22:08:35 runner system command -> ['/usr/bin/g++', 'Release/test_1.o', '-o', '/home/sigyun/Downloads/node_modules/db-oracle/build/.conf_check_0/testbuild/Release/testprog', '-L/opt/instantclient', '-locci', '-lclntsh', '-lnnz11']
Missing include files for OCI
/home/sigyun/Downloads/node_modules/db-oracle/wscript:42: error: the configuration failed (see '/home/sigyun/Downloads/node_modules/db-oracle/build/config.log')

and this is config.log

<==
[1/2] �[32mcxx: build/.conf_check_0/test.cpp -> build/.conf_check_0/testbuild/Release/test_1.o
�[0m['/usr/bin/g++', '-g', '-Wall', '-I/opt/instantclient/sdk/include/', '../test.cpp', '-c', '-o', 'Release/test_1.o']
[2/2] �[33mcxx_link: build/.conf_check_0/testbuild/Release/test_1.o -> build/.conf_check_0/testbuild/Release/testprog
�[0m/usr/bin/ld: skipping incompatible /opt/instantclient/libocci.so when searching for -locci
/usr/bin/ld: cannot find -locci
/usr/bin/ld: skipping incompatible /opt/instantclient/libclntsh.so when searching for -lclntsh
/usr/bin/ld: cannot find -lclntsh
/usr/bin/ld: skipping incompatible /opt/instantclient/libnnz11.so when searching for -lnnz11
/usr/bin/ld: cannot find -lnnz11
collect2: ld returned 1 exit status
['/usr/bin/g++', 'Release/test_1.o', '-o', '/home/sigyun/Downloads/node_modules/db-oracle/build/.conf_check_0/testbuild/Release/testprog', '-L/opt/instantclient', '-locci', '-lclntsh', '-lnnz11']
command returned 'Build failed: -> task failed (err #1): \n\t{task: cxx_link test_1.o -> testprog}'Missing include files for OCI

I think it couldn't find include file
like locci / lclntsh and lnnz11

but I already set OCI_INCLUDE_DIR and OCI_LIB_DIR

declare -x OCI_INCLUDE_DIR="/opt/instantclient/sdk/include/"
declare -x OCI_LIB_DIR="/opt/instantclient"

so, I don't know what to do help me T T

Connection flushing?

I'm working on a simple service that receives uploaded files, stores them on the disk and records some metadata on an Oracle table. I'm using the db-oracle package together with connection pooling, following this article: http://nodejsdb.org/2011/05/connection-pooling-node-db-with-generic-pool/

However, I've noticed that the data I insert is only sent to the Oracle database after the connection pool closes the idle connection, by calling its disconnect() method.

I need a way to flush the data before sending the 'OK' signal to my client, otherwise a crash on my webservice or on Oracle itself can cause loss of data. I actually tested this by killing my app process after some uploads, and the data was indeed lost.

As a workaround, I've tried to implement a fake connection pool and release all acquired connections, but now my app is dying with the message: pure virtual method calledAbort trap: 6

Here's the fake connection pooling:

var fakePool = {
  acquire: function(callback) {
    new oracle.Database(config.database).connect(function(err, server) {
      callback(err, this);
    });
  },
  release: function(conn) {
    conn.disconnect();
  }
};

Just to be clear, I don't care about the fake connection pooler, the real problem is the absence of a flush() method or something similar.

Failure when inserting single quote (')

The following code causes this error. If I remove the single quote from "Bob O'Neill" (ie "Bob ONeill") it works.

var oracle = require('db-oracle');

var client = new oracle.Database({
  hostname: "localhost",
  user: "test",
  password: "test"
});
client.connect(function(err) {
  if(err) { callback(err); return; }
  client.query().execute("INSERT INTO Person(name,age) VALUES(?,?)", [ 'Bob O\'Neill', 21 ], function(err, results) {
    console.log(err, results);
  });
});
terminate called after throwing an instance of 'oracle::occi::SQLException'
  what():  ORA-01756: quoted string not properly terminated

Build node-db-oracle on Debian with Oracle 10xe

Hi,

I tried to build node-db-oracle on a debian system, the instantclient path output looks like this:

HOSTNAME:/opt/node# ls -la  $OCI_INCLUDE_DIR $OCI_LIB_DIR
/opt/instantclient/lib/:
insgesamt 100164
drwxr-xr-x 2 root root     4096 16. Mär 18:35 .
drwxr-xr-x 4 root root     4096 16. Mär 18:30 ..
-rw-rw-r-- 1 root root      222 19. Apr 2010  BASIC_README
-r--r--r-- 1 root root  1621582 19. Apr 2010  classes12.jar
-rwxrwxr-x 1 root root    67582 19. Apr 2010  genezi
lrwxrwxrwx 1 root root       17 16. Mär 18:35 libclntsh.so -> libclntsh.so.10.1
-rwxrwxr-x 1 root root 19235764 19. Apr 2010  libclntsh.so.10.1
-r-xr-xr-x 1 root root  5659007 19. Apr 2010  libnnz10.so
lrwxrwxrwx 1 root root       15 16. Mär 18:35 libocci.so -> libocci.so.10.1
-rwxrwxr-x 1 root root  1403708 19. Apr 2010  libocci.so.10.1
-rwxrwxr-x 1 root root 72726010 19. Apr 2010  libociei.so
-r-xr-xr-x 1 root root   120843 19. Apr 2010  libocijdbc10.so
-r--r--r-- 1 root root  1569316 19. Apr 2010  ojdbc14.jar

/opt/instantclient/sdk/include/:
insgesamt 1500
drwxrwxr-x 2 root root   4096 19. Apr 2010  .
drwxrwxr-x 4 root root   4096 19. Apr 2010  ..
-r--r--r-- 1 root root  33230 19. Apr 2010  nzerror.h
-r--r--r-- 1 root root  85310 19. Apr 2010  nzt.h
-r--r--r-- 1 root root  11600 19. Apr 2010  occiAQ.h
-r--r--r-- 1 root root  38724 19. Apr 2010  occiCommon.h
-r--r--r-- 1 root root  73063 19. Apr 2010  occiControl.h
-r--r--r-- 1 root root  35218 19. Apr 2010  occiData.h
-r--r--r-- 1 root root   2115 19. Apr 2010  occi.h
-r--r--r-- 1 root root  29307 19. Apr 2010  occiObjects.h
-r-xr-xr-x 1 root root   7155 19. Apr 2010  oci1.h
-r--r--r-- 1 root root  10361 19. Apr 2010  oci8dp.h
-r--r--r-- 1 root root 411221 19. Apr 2010  ociap.h
-r-xr-xr-x 1 root root   6055 19. Apr 2010  ociapr.h
-r--r--r-- 1 root root  43225 19. Apr 2010  ocidef.h
-r-xr-xr-x 1 root root   4014 19. Apr 2010  ocidem.h
-r--r--r-- 1 root root  11331 19. Apr 2010  ocidfn.h
-r--r--r-- 1 root root   8954 19. Apr 2010  ociextp.h
-r--r--r-- 1 root root 153066 19. Apr 2010  oci.h
-r-xr-xr-x 1 root root   6638 19. Apr 2010  ocikpr.h
-r--r--r-- 1 root root   4351 19. Apr 2010  ocixmldb.h
-r--r--r-- 1 root root  19099 19. Apr 2010  odci.h
-r-xr-xr-x 1 root root   6605 19. Apr 2010  oratypes.h
-r--r--r-- 1 root root  15031 19. Apr 2010  orid.h
-r--r--r-- 1 root root 102726 19. Apr 2010  ori.h
-r--r--r-- 1 root root 157674 19. Apr 2010  orl.h
-r--r--r-- 1 root root  42626 19. Apr 2010  oro.h
-r--r--r-- 1 root root 116591 19. Apr 2010  ort.h
-r-xr-xr-x 1 root root   9520 19. Apr 2010  xa.h

output for the build, using "node-waf"

HOSTNAME:/opt/node/node_modules/db-oracle# node-waf configure build --verbose
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for header occi.h               : 18:40:06 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-I/opt/instantclient/sdk/include/', '../test.cpp', '-c', '-o', 'Release/test_1.o']
18:40:07 runner system command -> ['/usr/bin/g++', 'Release/test_1.o', '-o', '/opt/node/node_modules/db-oracle/build/.conf_check_0/testbuild/Release/testprog', '-L/opt/instantclient/lib/', '-locci', '-lclntsh', '-lnnz11']
Missing include files for OCI 
/opt/node/node_modules/db-oracle/wscript:42: error: the configuration failed (see '/opt/node/node_modules/db-oracle/build/config.log')

any ideas - what I am doing wrong?

Windows Support

I realize that Node.js is primarily used on Unix based systems but I was wondering if this project would be made compatible with Windows. I'm forced to use a windows environment at work but I would love to start using Node.js. My work also uses an Oracle database and I have not found a way to connect to Oracle with Node.js in Windows. This project is the closest thing I've found. I understand if this is too difficult but I wanted to put the request in if it was possible.

Cannot install on OS X

When issuing 'npm install db-oracle' on Mac OSX, the following error occurs:

Checking for header occi.h               : Missing include files for OCI 
/Users/dev/.npm/db-oracle/0.1.3/package/wscript:42: error: the configuration failed (see '/Users/dev/.npm/db-oracle/0.1.3/package/build/config.log')
npm ERR! [email protected] install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the db-oracle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls db-oracle
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "."
npm ERR! cwd /Users/dev/.npm/db-oracle/0.1.3/package
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.27
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/dev/.npm/db-oracle/0.1.3/package/npm-debug.log
npm not ok

The underlying error is:

ld: library not found for -locci
collect2: ld returned 1 exit status

It looks like the install script is failing when attempting to execute the following line:

/usr/bin/g++ default/test_1.o -o /Users/dev/.npm/db-oracle/0.1.3/package/build/.conf_check_0/testbuild/default/testprog -L/opt/instantclient -locci -lclntsh -lnnz11

I can confirm that the instantclient dir is at /opt/instantclient and the sdk is at /opt/instantclient/sdk. I suspect that it doesn't work with the mac version of instant client. It's version 10. Looks like linux is at version 11.

Get last insert id via a returning statement

I'm working on an ORM framework for node.js (https://github.com/nearinfinity/node-persist/) and I need a way to get the last inserted id. I have a table Person with columns id, name, age. The id column is associated with a sequence via a before insert trigger. I would like to get the id out when I execute the following sequence.

INSERT INTO Person (name, age) VALUES ('bob', 23) RETURNING id INTO ?

I would love to use your oracle driver but it doesn't look like there is any way to bind out parameters via the execute command.

I have a branch here: https://github.com/nearinfinity/node-persist/tree/db-oracle which is the start of incorporating your driver but if you run the nodeunit tests on select.js you will see I cannot get the id column back out.

Oracle stored procedure with OUT parameters

I have an Oracle stored procedure like this:

CREATE OR REPLACE PROCEDURE Sp_CheckName(in_Name IN VARCHAR2, out_Ret OUT VARCHAR2) IS
cnt NUMBER;
BEGIN
SELECT COUNT(1) INTO cnt FROM Person WHERE NAME = in_Name;
out_Ret := cnt;
END Sp_CheckName;

Is any idea for me to get out_Ret value in javascript by node-db-oracle?
Thanks.

SegFault when performing SELECT to alternate schema

I am getting a SegFault when I try to do a SELECT to alternate schema. No SegFault when schema is not specified or changed. Assume code excerpts occurs after valid connection and authentication have taken place.

First scenario:

db.query().execute("SELECT * FROM greensboro.address_lt", function(error, rows, cols) { ... }

Yields:

Segmentation fault (core dumped)

Second scenario:

db.query().execute('ALTER SESSION SET CURRENT_SCHEMA = greensboro', function(error, rows, cols) {
    db.query().execute("SELECT * FROM address_lt", function(error, rows, cols) { ... }
}

Yields:

Segmentation fault (core dumped)

Details:

  • Oracle 11g
  • Ubuntu 32bit Server 12.04
  • Node 0.6.16
  • db-oracle 0.2.3

error while installing db-oracle package on windows 7

C:\Users>npm install db-oracle
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/db-oracle
npm http 304 https://registry.npmjs.org/db-oracle

[email protected] install C:\Users\vishaltyagi\node_modules\db-oracle
node-waf configure build
'node-waf' is not recognized as an internal or external command,
operable program or batch file.

[email protected] preuninstall C:\Users\vishaltyagi\node_modules\db-oracle
rm -rf build/*
'rm' is not recognized as an internal or external command,
operable program or batch file.
npm WARN continuing anyway undefined
npm ERR! weird error 1
npm ERR! not ok code 0

OSX connection issues

Good morning,

I'm hoping you all can help me out. I'm just trying to connect to an oracle db on a mac pro running Lion. I've installed the 64bit instantclient (10.2.0.4.0) and gotten db-oracle installed successfully. When I try to connect, nothing happens. The callback never fires, no events get emitted, and my sadness is total. I DO get a warning (and the port is not standard, as you can see):

coffee> oracle=require 'db-oracle'
{ Query: [Function],
  Database: 
   { [Function]
     COLUMN_TYPE_STRING: 0,
     COLUMN_TYPE_BOOL: 7,
     COLUMN_TYPE_INT: 2,
     COLUMN_TYPE_NUMBER: 3,
     COLUMN_TYPE_DATE: 4,
     COLUMN_TYPE_TIME: 5,
     COLUMN_TYPE_DATETIME: 6,
     COLUMN_TYPE_TEXT: 1,
     COLUMN_TYPE_SET: 8 } }
coffee> db = new oracle.Database {hostname: 'example.com', user: 'user', password: 'pass', port: 1530, database: 'adb'}
{}
coffee> db.connect (err)->console.log 'connected', arguments
WARNING: ev_ref is deprecated, use uv_ref
undefined
coffee> 
coffee> db.isConnected()
false
coffee> 

I tried running sqlplus with the instantclient to check that I could connect to the db. it seg faults. That's apparently a known issue with the 64bit client and they who wish to overcome use the 32bit client. So I installed the 32bit client, and reinstalled db-oracle. I'm able to connect to the db with sqlplus with no problems, but even just requiring db-oracle fails:

coffee> oracle = require 'db-oracle'
Error: dlopen(/Users/rcurtis/Code/bigbang/node_modules/db-oracle/build/Release/oracle_bindings.node, 1): Symbol not found: __ZTIN6oracle4occi12SQLExceptionE
  Referenced from: /Users/rcurtis/Code/bigbang/node_modules/db-oracle/build/Release/oracle_bindings.node
  Expected in: flat namespace
 in /Users/rcurtis/Code/bigbang/node_modules/db-oracle/build/Release/oracle_bindings.node
    at Object.Module._extensions..node (module.js:485:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/Users/rcurtis/Code/bigbang/node_modules/db-oracle/db-oracle.js:18:15)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
coffee> 

I don't really care if I'm using the 32bit or the 64, as long as it works. Suggestions?

db-oracle Mac OS X installation - Part II

Hello again,

I'm trying to install the db-oracle on a Mac OS X Lion machine, and everything goes fine in the installation but, everytime that I try to run my application an error occurs. Just like that:

node server_js.js
node.js:189
    throw e; // process.nextTick error, or 'error' event on first tick
    ^
Error: dlopen(/Users/ricky/node_modules/db-oracle/build/default/oracle_bindings.node, 1): Symbol not found:  ZTIN6oracle4occi12SQLExceptionE
Referenced from: /Users/ricky/node_modules/db-oracle/build/default/oracle_bindings.node
Expected in: flat namespace
in /Users/ricky/node_modules/db-oracle/build/default/oracle_bindings.node
at Object..node (module.js:451:11)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at require (module.js:346:19)
at Object.<anonymous> (/Users/ricky/node_modules/db-oracle/db-oracle.js:12:15)
at Module._compile (module.js:406:26)
at Object..js (module.js:445:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at require (module.js:346:19)

For Mac OS X I have to use the version 10.2 of the instant client and sdk.
I make the links of the libnnz10.dylib to the libnnz11.dylib so it compiles without problems.

Anyone has any glue?

Missing include files for OCI

I am getting the same "Missing include files for OCI" error.

I am running
RedHat 2.6.32-131.2.1.el6.x86_64 #1 SMP Wed May 18 07:07:37 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

ls -la of $OCI_LIB_DIR =/ora11gR2/product/11.2.0/client_1/instantclient/

lrwxrwxrwx.  1 oracle oinstall       55 Jun  9 15:49 libclntsh.so.11.1 -> /ora11gR2/product/11.2.0/client_1/lib/libclntsh.so.11.1
lrwxrwxrwx.  1 oracle oinstall       54 Jun  9 15:49 libheteroxa11.so -> /ora11gR2/product/11.2.0/client_1/lib/libheteroxa11.so
lrwxrwxrwx.  1 oracle oinstall       49 Jun  9 15:49 libnnz11.so -> /ora11gR2/product/11.2.0/client_1/lib/libnnz11.so
lrwxrwxrwx.  1 oracle oinstall       53 Jun  9 15:49 libocci.so.11.1 -> /ora11gR2/product/11.2.0/client_1/lib/libocci.so.11.1
-rw-r--r--.  1 oracle oinstall 89382994 Aug 14  2009 libociei.so
lrwxrwxrwx.  1 oracle oinstall       53 Jun  9 15:49 libocijdbc11.so -> /ora11gR2/product/11.2.0/client_1/lib/libocijdbc11.so
-rw-r--r--.  1 oracle oinstall  1504295 Aug  3  2009 libsqlplusic.so
drwxr-xr-x.  2 oracle oinstall     4096 Jun  9 15:49 light
lrwxrwxrwx.  1 oracle oinstall       53 Jun  9 15:49 ojdbc5.jar -> /ora11gR2/product/11.2.0/client_1/jdbc/lib/ojdbc5.jar
drwxrwxr-x   4 root   root         4096 Jul  7 09:46 sdk

ls -la of $OCI_INCLUDE_DIR=/ora11gR2/product/11.2.0/client_1/instantclient/sdk/include/

-r-xr-xr-x 1 root root  42534 Jul  7 09:46 ldap.h
-r--r--r-- 1 root root  34157 Jul  7 09:46 nzerror.h
-r--r--r-- 1 root root  74787 Jul  7 09:46 nzt.h
-r--r--r-- 1 root root  11586 Jul  7 09:46 occiAQ.h
-r--r--r-- 1 root root  34750 Jul  7 09:46 occiCommon.h
-r--r--r-- 1 root root  70685 Jul  7 09:46 occiControl.h
-r--r--r-- 1 root root  39934 Jul  7 09:46 occiData.h
-r--r--r-- 1 root root   2115 Jul  7 09:46 occi.h
-r--r--r-- 1 root root  24778 Jul  7 09:46 occiObjects.h
-r-xr-xr-x 1 root root   7203 Jul  7 09:46 oci1.h
-r--r--r-- 1 root root  10361 Jul  7 09:46 oci8dp.h
-r--r--r-- 1 root root 431290 Jul  7 09:46 ociap.h
-r-xr-xr-x 1 root root   6204 Jul  7 09:46 ociapr.h
-r--r--r-- 1 root root  43001 Jul  7 09:46 ocidef.h
-r-xr-xr-x 1 root root   4048 Jul  7 09:46 ocidem.h
-r--r--r-- 1 root root  11339 Jul  7 09:46 ocidfn.h
-r--r--r-- 1 root root   8953 Jul  7 09:46 ociextp.h
-r--r--r-- 1 root root 171238 Jul  7 09:46 oci.h
-r-xr-xr-x 1 root root   6494 Jul  7 09:46 ocikpr.h
-r--r--r-- 1 root root   5927 Jul  7 09:46 ocixmldb.h
-r--r--r-- 1 root root 100456 Jul  7 09:46 ocixstream.h
-r--r--r-- 1 root root  23384 Jul  7 09:46 odci.h
-r-xr-xr-x 1 root root   6540 Jul  7 09:46 oratypes.h
-r--r--r-- 1 root root  15083 Jul  7 09:46 orid.h
-r--r--r-- 1 root root 102775 Jul  7 09:46 ori.h
-r--r--r-- 1 root root 157901 Jul  7 09:46 orl.h
-r--r--r-- 1 root root  42626 Jul  7 09:46 oro.h
-r--r--r-- 1 root root 116645 Jul  7 09:46 ort.h
-r-xr-xr-x 1 root root   9892 Jul  7 09:46 xa.h

node-waf configure build --verbose

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /node/node_modules/ 
Checking for node prefix                 : ok /root/local/node 
Checking for header occi.h               : 12:21:27 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-I/ora11gR2/product/11.2.0/client_1/instantclient/sdk/include/', '../test.cpp', '-c', '-o', 'default/test_1.o']
12:21:27 runner system command -> ['/usr/bin/g++', 'default/test_1.o', '-o', '/root/.npm/db-oracle/0.1.3/package/build/.conf_check_0/testbuild/default/testprog', '-L/ora11gR2/product/11.2.0/client_1/instantclient', '-locci', '-lclntsh', '-lnnz11']
Missing include files for OCI 
/root/.npm/db-oracle/0.1.3/package/wscript:42: error: the configuration failed (see '/root/.npm/db-oracle/0.1.3/package/build/config.log')

db-oracle Mac OS X installation

Hello,

I'm trying to use your driver (oracle) but every time that I run the command
npm install db-oracle

turns a error message like this:

[email protected] install /Users/ricky/node_modules/db-oracle
node-waf configure build

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /Users/ricky/local/node-v0.4.8
Checking for header occi.h : Missing include files for OCI
/Users/ricky/node_modules/db-oracle/wscript:42: error: the configuration failed (see '/Users/ricky/node_modules/db-oracle/build/config.log')
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/Users/ricky/local/node-v0.4.8/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:192:12)

[email protected] preuninstall /Users/ricky/node_modules/db-oracle
rm -rf build/*

npm ERR! [email protected] install: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the db-oracle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls db-oracle
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/Users/ricky/local/node/bin/npm" "install" "db-oracle"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/ricky/npm-debug.log
npm not ok

Yeah, I know... theres something with the env variable 'OCI_INCLUDE_DIR'. But the problem is that the two needed env variables are setted. And the files are in /opt/instantclient/sdk/include (occi.h) and /opt/instantclient/.
Do you know what else could be wrong?

Thank you
Regards.

require('db-oracle'); returns an error

Any Idea why this would happen?
spent all most whole day messing around and could not get it to work!

var oracle = require('db-oracle');
TypeError: Cannot read property 'prototype' of undefined
at extend (/node_modules/db-oracle/db-oracle.js:23:15)
at Object. (/node_modules/db-oracle/db-oracle.js:38:17)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at repl:1:14
at REPLServer.eval (repl.js:80:21)

please help!
thankx!

db-oracle crashed on ubuntu 10.04, Oracle 10gR2 client

Got:
mvtm@28-moskalyov:/tmp/oradb$ gdb --args node test.js
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/bin/node...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/node test.js
[Thread debugging using libthread_db enabled]
[New Thread 0xb5f45b70 (LWP 8735)]

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
#0 0x0012d422 in __kernel_vsyscall ()
#1 0x00457651 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0x0045aa82 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0x015b0db5 in __cxxabiv1::__terminate(void (*)()) () from /usr/lib/libstdc++.so.5
#4 0x015b0df2 in std::terminate() () from /usr/lib/libstdc++.so.5
#5 0x015b0f32 in __cxa_throw () from /usr/lib/libstdc++.so.5
#6 0x006b2e95 in destr_detour0 () from /opt/oracle/product/10.2.0/client_1/lib/libocci.so.10.1
#7 0x0064e65a in Connection (this=0x85cdc10) at ../src/connection.cc:9
#8 0x0064ed39 in Oracle (this=0x85cdc88) at ../src/oracle.cc:7
#9 0x0064f151 in node_db_oracle::Oracle::New (args=...) at ../src/oracle.cc:34
#10 0x081b800d in ?? ()

error while " npm install db-oracle "

hi
my os is centos 5.9 and my version of oracle database 11gR2 and my version of node.js 0.10.6.
i use your article , when i want to install db-oracle , the error is shown :
npm install db-oracle
npm http GET https://registry.npmjs.org/db-oracle
npm http 304 https://registry.npmjs.org/db-oracle

[email protected] install /opt/instantclient/node_modules/db-oracle
node-waf configure build

sh: node-waf: command not found

[email protected] preuninstall /opt/instantclient/node_modules/db-oracle
rm -rf build/*

npm ERR! weird error 127
npm ERR! not ok code 0

i want to use this version of node , not using 0.6.4 . do you have any solution ?

clob exception

Hi there!
oracle,select a clob type field,throw a exception like below:
terminate called after throwing an instance of 'oracle::occi::SQLException'
what(): ORA-01460: unimplemented or unreasonable conversion requested

Install failes

While installing on Oracle Linux 6 getting the following:

$ npm install db-oracle npm http GET https://registry.npmjs.org/db-oracle
npm http 304 https://registry.npmjs.org/db-oracle

[email protected] install /home/user1/node_modules/db-oracle
node-waf configure build

sh: node-waf: command not found

[email protected] preuninstall /home/user1/node_modules/db-oracle
rm -rf build/*

npm ERR! [email protected] install: node-waf configure build npm ERR! sh "-c" "node-waf configure build" failed with 127 npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the db-oracle package, npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls db-oracle
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.39-400.17.1.el6uek.x86_64 npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
"db-oracle"
npm ERR! cwd /home/user1/dev/Sublime Text 2 npm ERR! node -v v0.11.2-pre npm ERR! npm -v 1.2.18 npm ERR! code ELIFECYCLE npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user1/dev/Sublime Text 2/npm-debug.log
npm ERR! not ok code 0

Error: Unable to load shared library /usr/share/npm/node_modules/db-oracle/build/Release/oracle_bindings.node

This seem to be an ongoing problem.
I follow all the steps as described in https://github.com/mariano/node-db-oracle/
Environment variables are set as descirbed:

OCI_INCLUDE_DIR=/opt/instantclient/sdk/include
LD_LIBRARY_PATH=/opt/instantclient
OCI_LIB_DIR=/opt/instantclient

and

NODE_PATH=/usr/share/npm/node_modules

I was able to build successfully:

/usr/share/npm/node_modules $ sudo npm install db-oracle
npm http GET http://registry.npmjs.org/db-oracle
npm http 200 http://registry.npmjs.org/db-oracle
npm http GET http://registry.npmjs.org/db-oracle/-/db-oracle-0.2.3.tgz
npm http 200 http://registry.npmjs.org/db-oracle/-/db-oracle-0.2.3.tgz

[email protected] install /usr/share/npm/node_modules/db-oracle
node-waf configure build

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for header occi.h : yes
Checking for library occi : yes
'configure' finished successfully (0.604s)
Waf: Entering directory /usr/share/npm/node_modules/db-oracle/build' [ 1/12] cxx: lib/node-db/binding.cc -> build/Release/lib/node-db/binding_1.o [ 2/12] cxx: lib/node-db/connection.cc -> build/Release/lib/node-db/connection_1.o [ 3/12] cxx: lib/node-db/events.cc -> build/Release/lib/node-db/events_1.o [ 4/12] cxx: lib/node-db/exception.cc -> build/Release/lib/node-db/exception_1.o [ 5/12] cxx: lib/node-db/query.cc -> build/Release/lib/node-db/query_1.o [ 6/12] cxx: lib/node-db/result.cc -> build/Release/lib/node-db/result_1.o [ 7/12] cxx: src/connection.cc -> build/Release/src/connection_1.o [ 8/12] cxx: src/oracle.cc -> build/Release/src/oracle_1.o [ 9/12] cxx: src/query.cc -> build/Release/src/query_1.o [10/12] cxx: src/result.cc -> build/Release/src/result_1.o [11/12] cxx: src/oracle_bindings.cc -> build/Release/src/oracle_bindings_1.o [12/12] cxx_link: build/Release/lib/node-db/binding_1.o build/Release/lib/node-db/connection_1.o build/Release/lib/node-db/events_1.o build/Release/lib/node-db/exception_1.o build/Release/lib/node-db/query_1.o build/Release/lib/node-db/result_1.o build/Release/src/connection_1.o build/Release/src/oracle_1.o build/Release/src/query_1.o build/Release/src/result_1.o build/Release/src/oracle_bindings_1.o -> build/Release/oracle_bindings.node Waf: Leaving directory/usr/share/npm/node_modules/db-oracle/build'
'build' finished successfully (1.532s)
[email protected] ./db-oracle

everything looks great. I run my node js script and I get:

$ node SDPServer.js

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unable to load shared library /usr/share/npm/node_modules/db-oracle/build/Release/oracle_bindings.node
at Object..node (module.js:472:11)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at /usr/share/npm/node_modules/db-oracle/db-oracle.js:18:15
at Module._compile (module.js:412:14)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)

Note that the script contains the sample code you posted:

var oracle = require('db-oracle');

new oracle.Database({
hostname: '173.4.4.4',
user: 'dasfdsfasd',
password: 'dsfsdafsd',
database: 'sdafasdfsd'
}).connect(function(error) {
if (error) {
return console.log("CONNECTION ERROR: " + error);
}

this.query().select('*').from('Devices').execute(function(error, rows) {
    if (error) {
        return console.log('ERROR: ' + error);
    }
    console.log(rows.length + ' ROWS');
});

});

Now if cat the file: /usr/share/npm/node_modules/db-oracle/build/Release/oracle_bindings.node it does exist with some content. The db-oracle directory structure looks like this:

/usr/share/npm/node_modules/db-oracle $ tree
.
├── build
│   ├── c4che
│   │   ├── build.config.py
│   │   └── Release.cache.py
│   ├── config.log
│   └── Release
│   ├── lib
│   │   └── node-db
│   │   ├── binding_1.o
│   │   ├── connection_1.o
│   │   ├── events_1.o
│   │   ├── exception_1.o
│   │   ├── query_1.o
│   │   └── result_1.o
│   ├── oracle_bindings.node
│   └── src
│   ├── connection_1.o
│   ├── oracle_1.o
│   ├── oracle_bindings_1.o
│   ├── query_1.o
│   └── result_1.o
├── db-oracle.js
├── lib
│   └── node-db
│   ├── binding.cc
│   ├── binding.h
│   ├── connection.cc
│   ├── connection.h
│   ├── events.cc
│   ├── events.h
│   ├── exception.cc
│   ├── exception.h
│   ├── node_defs.h
│   ├── query.cc
│   ├── query.h
│   ├── README.md
│   ├── result.cc
│   ├── result.h
│   └── tests.js
├── oracle-test-async.js
├── oracle-test.js
├── package.json
├── README.md
├── src
│   ├── connection.cc
│   ├── connection.h
│   ├── oracle_bindings.cc
│   ├── oracle.cc
│   ├── oracle.h
│   ├── query.cc
│   ├── query.h
│   ├── result.cc
│   └── result.h
├── testing
│   ├── test
│   └── test.cc
├── tests.js
└── wscript

10 directories, 48 files

So ... I lost a day here so far .... I read similar posts and pretty much have everything that has been suggested. Seems like it is complaining not finding something that clearly exists. Any advice here in how to move forward ??

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.