GithubHelp home page GithubHelp logo

ibmdb / node-ibm_db Goto Github PK

View Code? Open in Web Editor NEW
188.0 188.0 151.0 114 MB

IBM DB2 and IBM Informix bindings for node

License: MIT License

Python 0.51% JavaScript 61.29% C++ 35.41% C 2.23% Shell 0.37% HTML 0.05% Batchfile 0.14%

node-ibm_db's People

Contributors

akhilravuri1 avatar akpotohwo avatar alexcfyung avatar ashutoshrnjn avatar asselin avatar avikalar avatar bbigras avatar bimaljha avatar bimalkjha avatar dependabot[bot] avatar elkorep avatar guilherme-gm avatar gurzgri avatar idbjorh avatar joransiu avatar laijonathan avatar lee-houghton avatar mariobriggs avatar matpasha avatar platformamoja avatar praveend avatar priyankamanoharan04 avatar prsahoo avatar rhtpandeyin avatar theduderog avatar viniciusls avatar vyshakh18 avatar w1nk avatar wankdanker avatar yorickvp 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-ibm_db's Issues

Empty result after INSERT query

Hi!

First of all, thanks for sharing this library!

The problem here is with the result of the 'INSERT' query.
Take the following example:

conn.query('INSERT INTO Users (name, age) VALUES ("Wilk", 26)', function (err, result) {
  if (err) cb(err);
  else cb(null, result);
});

I expect that 'result' has the new inserted record with an unique ID but what I got is an empty array.
What's wrong with it? Is it a wanted behaviour?

Thanks in advance.

Ubuntu install fails

Trying to install on node 0.11.14 and Ubuntu 15.04, I get the following error:

> [email protected] install /srv/v4/node_modules/ibm_db
> node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz...
Download and extraction of DB2 ODBC CLI Driver completed successfully ...
make: Entering directory '/srv/v4/node_modules/ibm_db/build'
  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
odbc_bindings.target.mk:99: recipe for target 'Release/obj.target/odbc_bindings/src/odbc.o' failed
make: Leaving directory '/srv/v4/node_modules/ibm_db/build'

{ [Error: Command failed: /bin/sh -c node-gyp configure build --IBM_DB_HOME=$IBM_DB_HOME --IBM_DB_HOME_WIN=%IBM_DB_HOME% --IS_DOWNLOADED=true
In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:76:85: error: ‘NanCallback’ has not been declared
     static Handle<Value> CallbackSQLError(SQLSMALLINT handleType, SQLHANDLE handle, NanCallback* cb);
                                                                                     ^
../src/odbc.h:77:101: error: ‘NanCallback’ has not been declared
     static Handle<Value> CallbackSQLError (SQLSMALLINT handleType, SQLHANDLE handle, char* message, NanCallback* cb);
                                                                                                     ^
../src/odbc.h:112:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
In file included from ../src/odbc.cpp:26:0:
../src/odbc_connection.h:95:7: error: ‘NanCallback’ does not name a type
       NanCallback* callback;
       ^
../src/odbc_connection.h:113:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc_connection.h:120:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc_connection.h:143:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc_connection.h:151:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
In file included from ../src/odbc.cpp:27:0:
../src/odbc_result.h:66:7: error: ‘NanCallback’ does not name a type
       NanCallback* cb;
       ^
In file included from ../src/odbc.cpp:28:0:
../src/odbc_statement.h:73:7: error: ‘NanCallback’ does not name a type
       NanCallback* callback;
       ^
../src/odbc_statement.h:95:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc_statement.h:103:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc_statement.h:109:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc_statement.h:117:3: error: ‘NanCallback’ does not name a type
   NanCallback* cb;
   ^
../src/odbc.cpp: In static member function ‘static void ODBC::Init(v8::Handle<v8::Object>)’:
../src/odbc.cpp:48:12: error: ‘NanScope’ was not declared in this scope
   NanScope();
            ^
../src/odbc.cpp:50:50: error: ‘NanNew’ was not declared in this scope
   Local<FunctionTemplate> constructor_template = NanNew<FunctionTemplate>(New);
                                                  ^
../src/odbc.cpp:50:73: error: expected primary-expression before ‘>’ token
   Local<FunctionTemplate> constructor_template = NanNew<FunctionTemplate>(New);
                                                                         ^
../src/odbc.cpp:66:42: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_CLOSE"), NanNew<Number>(SQL_CLOSE), constant_attributes);
                                          ^
../src/odbc.cpp:66:71: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_CLOSE"), NanNew<Number>(SQL_CLOSE), constant_attributes);
                                                                       ^
../src/odbc.cpp:67:42: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_DROP"), NanNew<Number>(SQL_DROP), constant_attributes);
                                          ^
../src/odbc.cpp:67:70: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_DROP"), NanNew<Number>(SQL_DROP), constant_attributes);
                                                                      ^
../src/odbc.cpp:68:42: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_UNBIND"), NanNew<Number>(SQL_UNBIND), constant_attributes);
                                          ^
../src/odbc.cpp:68:72: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_UNBIND"), NanNew<Number>(SQL_UNBIND), constant_attributes);
                                                                        ^
../src/odbc.cpp:69:42: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_RESET_PARAMS"), NanNew<Number>(SQL_RESET_PARAMS), constant_attributes);
                                          ^
../src/odbc.cpp:69:78: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_RESET_PARAMS"), NanNew<Number>(SQL_RESET_PARAMS), constant_attributes);
                                                                              ^
../src/odbc.cpp:70:42: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_DESTROY"), NanNew<Number>(SQL_DESTROY), constant_attributes);
                                          ^
../src/odbc.cpp:70:73: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("SQL_DESTROY"), NanNew<Number>(SQL_DESTROY), constant_attributes);
                                                                         ^
../src/odbc.cpp:71:42: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("FETCH_ARRAY"), NanNew<Number>(FETCH_ARRAY), constant_attributes);
                                          ^
../src/odbc.cpp:71:73: error: expected primary-expression before ‘>’ token
   constructor_template->Set(NanNew<String>("FETCH_ARRAY"), NanNew<Number>(FETCH_ARRAY), constant_attributes);
                                                                         ^
In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:235:44: error: expected primary-expression before ‘>’ token
   (constructor_template)->Set(NanNew<String>(#constant),                \
                                            ^
../src/odbc.cpp:72:3: note: in expansion of macro ‘NODE_ODBC_DEFINE_CONSTANT’
   NODE_ODBC_DEFINE_CONSTANT(constructor_template, FETCH_OBJECT);
   ^
../src/odbc.h:236:30: error: expected primary-expression before ‘>’ token
                 NanNew<Number>(constant),                               \
                              ^
../src/odbc.cpp:72:3: note: in expansion of macro ‘NODE_ODBC_DEFINE_CONSTANT’
   NODE_ODBC_DEFINE_CONSTANT(constructor_template, FETCH_OBJECT);
   ^
../src/odbc.cpp:75:87: error: invalid conversion from ‘Nan::NAN_METHOD_RETURN_TYPE (*)(Nan::NAN_METHOD_ARGS_TYPE) {aka void (*)(const Nan::FunctionCallbackInfo<v8::Value>&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "createConnection", CreateConnection);
                                                                                       ^
In file included from ../src/odbc.cpp:20:0:
/root/.node-gyp/0.12.7/src/node.h:244:13: note: initializing argument 3 of ‘void node::NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate>, const char*, v8::FunctionCallback)’
 inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate> recv,
             ^
../src/odbc.cpp:76:95: error: invalid conversion from ‘Nan::NAN_METHOD_RETURN_TYPE (*)(Nan::NAN_METHOD_ARGS_TYPE) {aka void (*)(const Nan::FunctionCallbackInfo<v8::Value>&)}’ to ‘v8::FunctionCallback {aka void (*)(const v8::FunctionCallbackInfo<v8::Value>&)}’ [-fpermissive]
   NODE_SET_PROTOTYPE_METHOD(constructor_template, "createConnectionSync", CreateConnectionSync);
                                                                                               ^
In file included from ../src/odbc.cpp:20:0:
/root/.node-gyp/0.12.7/src/node.h:244:13: note: initializing argument 3 of ‘void node::NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate>, const char*, v8::FunctionCallback)’
 inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate> recv,
             ^
../src/odbc.cpp:79:71: error: ‘NanAssignPersistent’ was not declared in this scope
   NanAssignPersistent(constructor, constructor_template->GetFunction());
                                                                       ^
../src/odbc.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE ODBC::New(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/odbc.cpp:124:12: error: ‘NanScope’ was not declared in this scope
   NanScope();
            ^
../src/odbc.cpp:127:13: error: ‘args’ was not declared in this scope
   dbo->Wrap(args.Holder());
             ^
../src/odbc.cpp:143:34: error: ‘NanThrowError’ was not declared in this scope
     return NanThrowError(objError);
                                  ^
../src/odbc.cpp:143:34: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/odbc.cpp:149:31: error: ‘NanReturnValue’ was not declared in this scope
   NanReturnValue(args.Holder());
                               ^
../src/odbc.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE ODBC::CreateConnection(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/odbc.cpp:163:12: error: ‘NanScope’ was not declared in this scope
   NanScope();
            ^
../src/odbc.cpp:165:24: error: ‘args’ was not declared in this scope
   Local<Function> cb = args[0].As<Function>();
                        ^
../src/odbc.cpp:165:43: error: expected primary-expression before ‘>’ token
   Local<Function> cb = args[0].As<Function>();
                                           ^
../src/odbc.cpp:165:45: error: expected primary-expression before ‘)’ token
   Local<Function> cb = args[0].As<Function>();
                                             ^
../src/odbc.cpp:166:3: error: ‘NanCallback’ was not declared in this scope
   NanCallback *callback = new NanCallback(cb);
   ^
../src/odbc.cpp:166:16: error: ‘callback’ was not declared in this scope
   NanCallback *callback = new NanCallback(cb);
                ^
../src/odbc.cpp:166:31: error: expected type-specifier before ‘NanCallback’
   NanCallback *callback = new NanCallback(cb);
                               ^
../src/odbc.cpp:178:9: error: ‘struct create_connection_work_data’ has no member named ‘cb’
   data->cb = callback;
         ^
../src/odbc.cpp:187:31: error: ‘NanUndefined’ was not declared in this scope
   NanReturnValue(NanUndefined());
                               ^
../src/odbc.cpp:187:32: error: ‘NanReturnValue’ was not declared in this scope
   NanReturnValue(NanUndefined());
                                ^
../src/odbc.cpp:165:19: warning: unused variable ‘cb’ [-Wunused-variable]
   Local<Function> cb = args[0].As<Function>();
                   ^
../src/odbc.cpp: In static member function ‘static void ODBC::UV_AfterCreateConnection(uv_work_t*, int)’:
../src/odbc.cpp:206:12: error: ‘NanScope’ was not declared in this scope
   NanScope();
            ^
../src/odbc.cpp:217:11: error: ‘struct create_connection_work_data’ has no member named ‘cb’
     data->cb->Call(1, args);
           ^
../src/odbc.cpp:221:15: error: ‘NanNew’ was not declared in this scope
     args[0] = NanNew<External>(data->dbo->m_hEnv);
               ^
../src/odbc.cpp:221:30: error: expected primary-expression before ‘>’ token
     args[0] = NanNew<External>(data->dbo->m_hEnv);
                              ^
../src/odbc.cpp:222:30: error: expected primary-expression before ‘>’ token
     args[1] = NanNew<External>(data->hDBC);
                              ^
../src/odbc.cpp:224:46: error: expected primary-expression before ‘>’ token
     Local<Object> js_result = NanNew<Function>(ODBCConnection::constructor)->NewInstance(2, args);
                                              ^
../src/odbc.cpp:224:76: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
     Local<Object> js_result = NanNew<Function>(ODBCConnection::constructor)->NewInstance(2, args);
                                                                            ^
../src/odbc.cpp:226:27: error: expected primary-expression before ‘>’ token
     args[0] = NanNew<Value>(NanNull());
                           ^
../src/odbc.cpp:226:37: error: ‘NanNull’ was not declared in this scope
     args[0] = NanNew<Value>(NanNull());
                                     ^
../src/odbc.cpp:229:11: error: ‘struct create_connection_work_data’ has no member named ‘cb’
     data->cb->Call(2, args);
           ^
../src/odbc.cpp:238:16: error: ‘struct create_connection_work_data’ has no member named ‘cb’
   delete data->cb;
                ^
../src/odbc.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE ODBC::CreateConnectionSync(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/odbc.cpp:250:12: error: ‘NanScope’ was not declared in this scope
   NanScope();
            ^
../src/odbc.cpp:252:40: error: ‘args’ was not declared in this scope
   ODBC* dbo = ObjectWrap::Unwrap<ODBC>(args.Holder());
                                        ^
../src/odbc.cpp:268:15: error: ‘NanNew’ was not declared in this scope
   params[0] = NanNew<External>(dbo->m_hEnv);
               ^
../src/odbc.cpp:268:30: error: expected primary-expression before ‘>’ token
   params[0] = NanNew<External>(dbo->m_hEnv);
                              ^
../src/odbc.cpp:269:30: error: expected primary-expression before ‘>’ token
   params[1] = NanNew<External>(hDBC);
                              ^
../src/odbc.cpp:271:44: error: expected primary-expression before ‘>’ token
   Local<Object> js_result = NanNew<Function>(ODBCConnection::constructor)->NewInstance(2, params);
                                            ^
../src/odbc.cpp:271:74: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
   Local<Object> js_result = NanNew<Function>(ODBCConnection::constructor)->NewInstance(2, params);
                                                                          ^
../src/odbc.cpp:273:27: error: ‘NanReturnValue’ was not declared in this scope
   NanReturnValue(js_result);
                           ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetColumnValue(SQLHSTMT, Column, uint16_t*, int)’:
../src/odbc.cpp:369:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:397:41: error: ‘NanNull’ was not declared in this scope
           return NanEscapeScope(NanNull());
                                         ^
../src/odbc.cpp:397:42: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNull());
                                          ^
../src/odbc.cpp:400:33: error: ‘NanNew’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>((int)value));
                                 ^
../src/odbc.cpp:400:46: error: expected primary-expression before ‘>’ token
           return NanEscapeScope(NanNew<Number>((int)value));
                                              ^
../src/odbc.cpp:400:59: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>((int)value));
                                                           ^
../src/odbc.cpp:403:33: error: ‘NanNew’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>((short)value));
                                 ^
../src/odbc.cpp:403:46: error: expected primary-expression before ‘>’ token
           return NanEscapeScope(NanNew<Number>((short)value));
                                              ^
../src/odbc.cpp:403:61: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>((short)value));
                                                             ^
../src/odbc.cpp:406:33: error: ‘NanNew’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>((long)value));
                                 ^
../src/odbc.cpp:406:46: error: expected primary-expression before ‘>’ token
           return NanEscapeScope(NanNew<Number>((long)value));
                                              ^
../src/odbc.cpp:406:60: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>((long)value));
                                                            ^
../src/odbc.cpp:409:33: error: ‘NanNew’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>(value));
                                 ^
../src/odbc.cpp:409:46: error: expected primary-expression before ‘>’ token
           return NanEscapeScope(NanNew<Number>(value));
                                              ^
../src/odbc.cpp:409:54: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>(value));
                                                      ^
../src/odbc.cpp:435:41: error: ‘NanNull’ was not declared in this scope
           return NanEscapeScope(NanNull());
                                         ^
../src/odbc.cpp:435:42: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNull());
                                          ^
../src/odbc.cpp:439:33: error: ‘NanNew’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>(value));
                                 ^
../src/odbc.cpp:439:46: error: expected primary-expression before ‘>’ token
           return NanEscapeScope(NanNew<Number>(value));
                                              ^
../src/odbc.cpp:439:54: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNew<Number>(value));
                                                      ^
../src/odbc.cpp:506:39: error: ‘NanNull’ was not declared in this scope
         return NanEscapeScope(NanNull());
                                       ^
../src/odbc.cpp:506:40: error: ‘NanEscapeScope’ was not declared in this scope
         return NanEscapeScope(NanNull());
                                        ^
../src/odbc.cpp:525:31: error: ‘NanNew’ was not declared in this scope
         return NanEscapeScope(NanNew<Date>((double(timelocal(&timeInfo)) * 1000)
                               ^
../src/odbc.cpp:525:42: error: expected primary-expression before ‘>’ token
         return NanEscapeScope(NanNew<Date>((double(timelocal(&timeInfo)) * 1000)
                                          ^
../src/odbc.cpp:526:59: error: ‘NanEscapeScope’ was not declared in this scope
                           + (odbcTime.fraction / 1000000)));
                                                           ^
../src/odbc.cpp:548:39: error: ‘NanNull’ was not declared in this scope
         return NanEscapeScope(NanNull());
                                       ^
../src/odbc.cpp:548:40: error: ‘NanEscapeScope’ was not declared in this scope
         return NanEscapeScope(NanNull());
                                        ^
../src/odbc.cpp:552:69: error: ‘NanNew’ was not declared in this scope
         return NanEscapeScope(NanNew((*buffer == '0') ? false : true));
                                                                     ^
../src/odbc.cpp:552:70: error: ‘NanEscapeScope’ was not declared in this scope
         return NanEscapeScope(NanNew((*buffer == '0') ? false : true));
                                                                      ^
../src/odbc.cpp:577:41: error: ‘NanNull’ was not declared in this scope
           return NanEscapeScope(NanNull());
                                         ^
../src/odbc.cpp:577:42: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanNull());
                                          ^
../src/odbc.cpp:591:44: error: ‘NanNew’ was not declared in this scope
             str = NanNew((uint16_t*) buffer);
                                            ^
../src/odbc.cpp:599:64: error: ‘NanNew’ was not declared in this scope
             str = String::Concat(str, NanNew((uint16_t*) buffer));
                                                                ^
../src/odbc.cpp:623:13: error: ‘NanThrowError’ was not declared in this scope
            ));
             ^
../src/odbc.cpp:624:46: error: ‘NanUndefined’ was not declared in this scope
           return NanEscapeScope(NanUndefined());
                                              ^
../src/odbc.cpp:624:47: error: ‘NanEscapeScope’ was not declared in this scope
           return NanEscapeScope(NanUndefined());
                                               ^
../src/odbc.cpp:629:32: error: ‘NanEscapeScope’ was not declared in this scope
       return NanEscapeScope(str);
                                ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetRecordTuple(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
../src/odbc.cpp:640:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:642:25: error: ‘NanNew’ was not declared in this scope
   Local<Object> tuple = NanNew<Object>();
                         ^
../src/odbc.cpp:642:38: error: expected primary-expression before ‘>’ token
   Local<Object> tuple = NanNew<Object>();
                                      ^
../src/odbc.cpp:642:40: error: expected primary-expression before ‘)’ token
   Local<Object> tuple = NanNew<Object>();
                                        ^
../src/odbc.cpp:654:30: error: ‘NanEscapeScope’ was not declared in this scope
   return NanEscapeScope(tuple);
                              ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetRecordArray(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
../src/odbc.cpp:664:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:666:24: error: ‘NanNew’ was not declared in this scope
   Local<Array> array = NanNew<Array>();
                        ^
../src/odbc.cpp:666:36: error: expected primary-expression before ‘>’ token
   Local<Array> array = NanNew<Array>();
                                    ^
../src/odbc.cpp:666:38: error: expected primary-expression before ‘)’ token
   Local<Array> array = NanNew<Array>();
                                      ^
../src/odbc.cpp:673:30: error: ‘NanEscapeScope’ was not declared in this scope
   return NanEscapeScope(array);
                              ^
../src/odbc.cpp: At global scope:
../src/odbc.cpp:789:39: error: ‘NanCallback’ has not been declared
                                       NanCallback* cb) {
                                       ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, int*)’:
../src/odbc.cpp:790:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:796:8: error: ‘NanEscapeScope’ was not declared in this scope
     cb));
        ^
../src/odbc.cpp: At global scope:
../src/odbc.cpp:802:39: error: ‘NanCallback’ has not been declared
                                       NanCallback* cb) {
                                       ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, char*, int*)’:
../src/odbc.cpp:803:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:813:7: error: request for member ‘Call’ in ‘* cb’, which is of non-class type ‘int’
   cb->Call(1, args);
       ^
../src/odbc.cpp:815:38: error: ‘NanUndefined’ was not declared in this scope
   return NanEscapeScope(NanUndefined());
                                      ^
../src/odbc.cpp:815:39: error: ‘NanEscapeScope’ was not declared in this scope
   return NanEscapeScope(NanUndefined());
                                       ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE)’:
../src/odbc.cpp:823:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:828:38: error: ‘NanEscapeScope’ was not declared in this scope
     (char *) "[node-odbc] SQL_ERROR"));
                                      ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE, char*)’:
../src/odbc.cpp:832:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:836:28: error: ‘NanNew’ was not declared in this scope
   Local<Object> objError = NanNew<Object>();
                            ^
../src/odbc.cpp:836:41: error: expected primary-expression before ‘>’ token
   Local<Object> objError = NanNew<Object>();
                                         ^
../src/odbc.cpp:836:43: error: expected primary-expression before ‘)’ token
   Local<Object> objError = NanNew<Object>();
                                           ^
../src/odbc.cpp:858:37: error: expected primary-expression before ‘>’ token
   Local<Array> errors = NanNew<Array>();
                                     ^
../src/odbc.cpp:858:39: error: expected primary-expression before ‘)’ token
   Local<Array> errors = NanNew<Array>();
                                       ^
../src/odbc.cpp:894:33: error: ‘NanEscapeScope’ was not declared in this scope
   return NanEscapeScope(objError);
                                 ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Array> ODBC::GetAllRecordsSync(HENV, HDBC, HSTMT, uint16_t*, int)’:
../src/odbc.cpp:908:21: error: ‘NanEscapableScope’ was not declared in this scope
   NanEscapableScope();
                     ^
../src/odbc.cpp:910:28: error: ‘NanNew’ was not declared in this scope
   Local<Object> objError = NanNew<Object>();
                            ^
../src/odbc.cpp:910:41: error: expected primary-expression before ‘>’ token
   Local<Object> objError = NanNew<Object>();
                                         ^
../src/odbc.cpp:910:43: error: expected primary-expression before ‘)’ token
   Local<Object> objError = NanNew<Object>();
                                           ^
../src/odbc.cpp:918:35: error: expected primary-expression before ‘>’ token
   Local<Array> rows = NanNew<Array>();
                                   ^
../src/odbc.cpp:918:37: error: expected primary-expression before ‘)’ token
   Local<Array> rows = NanNew<Array>();
                                     ^
../src/odbc.cpp:961:29: error: ‘NanEscapeScope’ was not declared in this scope
   return NanEscapeScope(rows);
                             ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetColumnValue(SQLHSTMT, Column, uint16_t*, int)’:
../src/odbc.cpp:631:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetRecordTuple(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
../src/odbc.cpp:655:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetRecordArray(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
../src/odbc.cpp:674:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, int*)’:
../src/odbc.cpp:797:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, char*, int*)’:
../src/odbc.cpp:816:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE)’:
../src/odbc.cpp:829:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE, char*)’:
../src/odbc.cpp:895:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Array> ODBC::GetAllRecordsSync(HENV, HDBC, HSTMT, uint16_t*, int)’:
../src/odbc.cpp:962:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.19.0-22-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/srv/v4/node_modules/ibm_db/installer/clidriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=true"
gyp ERR! cwd /srv/v4/node_modules/ibm_db
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c node-gyp configure build --IBM_DB_HOME=$IBM_DB_HOME --IBM_DB_HOME_WIN=%IBM_DB_HOME% --IS_DOWNLOADED=true' }
npm ERR! Linux 3.19.0-22-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node installer/driverInstall.js'.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node installer/driverInstall.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls ibm_db
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /srv/v4/npm-debug.log

Memory leakage when query on z/os db2

We found memory leakage during performance test and locate the issue on this module. Here is a small express app that can reproduce the issue easily (memory increase until the server is frozen). I am wondering if someone can confirm it is caused by the way I use the driver or the leak is in the driver itself.

Thanks.

index.js

var express = require('express');
var app = express();
var retrievePosition = require('./lib/positionDaoWithGrouping');

app.get('/v1/parties/:key/positions', retrievePosition);

var server = app.listen(3000, function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log('Example app listening at http://%s:%s', host, port);
});

positionDaoWithGrouping.js

var dbConfig = require('./dbConfig.json');

var sql = 'SELECT ACC_NUM from ' +
  dbConfig.schema + '.ACCOUNT';

var cn = 'DATABASE=' + dbConfig.database + ';HOSTNAME=' + dbConfig.host +
  ';PORT=' + dbConfig.port + ';PROTOCOL=TCPIP;UID=' + dbConfig.userId +
  ';PWD=' + dbConfig.passwd + ';';

var ibmdb = require("ibm_db"), Pool = ibmdb.Pool, pool = new Pool();

module.exports = exports = function (req, res) {

  ibmdb.open(cn, function (err, connection) {
    try {
      if (err) {
        console.log(err);
        return;
      }
      connection.query(sql, function (err1, rows) {
        if (err1) {
          console.log(err1);
          return;
        }
        connection.close(function(err2) {
          if (err2) {
            console.log(err2);
          }
        });
        res.send(rows);
      });
    } catch (error) {
      console.log(error);
    }
  });
};

Installer will never use proxy settings

When trying install the module, download of the driver behind an enterprise firewall will always fail due to buildHttpOptions function always returning the default options.

function buildHttpOptions(installerfileURL) {
   var options = <init_value>

   ...
   exec('npm config get proxy', function(error, stdout, stderr) {

      ...
      options = <some_value>
      ...

   }
   ...   

   return options;
}

The above code will not affect the options because they've already been returned.

Query result cursor

I am trying to query a large table (1 mil rows). Ideally, i would like to iterate through a cursor rather than load the entire result set into memory. The driver appears to support this via the "moreResults" callback but i cannot make the driver return a partial result chunk. Is there a connection setting i need to enable?

npm install should provide diagnostics on error

This package appears to die various sorts of death when you don't have ODBC/sql stuff pre-installed on your system. Eg, when trying to install on my mac, I see:

> [email protected] preinstall ~/tmp/foo/bar/node_modules/ibm_db
> node-gyp configure build

  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
In file included from ../src/odbc.cpp:25:
../src/odbc.h:29:10: fatal error: 'sqlcli1.h' file not found
#include <sqlcli1.h>
         ^
1 error generated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
...
gyp ERR! command 
   "node" 
   "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" 
   "configure" 
   "build"
gyp ERR! cwd ~/tmp/foo/bar/node_modules/ibm_db
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok

Is there any way to "catch" that, to make it a little more understandable? Perhaps even tell the user where to get the package that needs to be pre-installed?

Does it work on RaspberryPi 2 (Rasbian OS)?

Does it work on RaspberryPi 2 (Rasbian OS)?

$ npm install ibm_db --save
........

[email protected] install /home/pi/html/www/node_modules/ibm_db
node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxia32_odbc_cli.tar.gz...
Download and extraction of DB2 ODBC CLI Driver completed successfully ...
make: Entering directory '/home/pi/html/www/node_modules/ibm_db/build'
CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
odbc_bindings.target.mk:88: recipe for target 'Release/obj.target/odbc_bindings/src/odbc.o' failed
make: Leaving directory '/home/pi/html/www/node_modules/ibm_db/build'

{ [Error: Command failed: In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:29:21: fatal error: sqlcli1.h: 그런 파일이나 디렉터리가 없습니다
compilation terminated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/sw/node-v0.10.28-linux-arm-pi/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Linux 3.18.7-v7+
gyp ERR! command "node" "/home/pi/sw/node-v0.10.28-linux-arm-pi/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/home/pi/html/www/node_modules/ibm_db/installer/clidriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=true"
gyp ERR! cwd /home/pi/html/www/node_modules/ibm_db
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
] killed: false, code: 1, signal: null }
[email protected] node_modules/ibm_db
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

$ node test.js (simple test)
/home/pi/html/www/node_modules/ibm_db/node_modules/bindings/bindings.js:87
throw err
^
Error: Could not load the bindings file. Tried:
→ /home/pi/html/www/node_modules/ibm_db/build/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/build/Debug/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/build/Release/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/out/Debug/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/Debug/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/out/Release/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/Release/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/build/default/odbc_bindings.node
→ /home/pi/html/www/node_modules/ibm_db/compiled/0.10.28/linux/arm/odbc_bindings.node
at bindings (/home/pi/html/www/node_modules/ibm_db/node_modules/bindings/bindings.js:84:13)
at Object. (/home/pi/html/www/node_modules/ibm_db/lib/odbc.js:25:31)
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)
at require (module.js:380:17)
at Object. (/home/pi/html/www/test.js:3:13)
at Module._compile (module.js:456:26)

Disconnection issues for DB pool

When trying to open a standard connection or a connection pool connection and the server is not reachable, node crashes with the following message:

FATAL ERROR: v8::HandleScope::Close() Local scope has already been closed

Is there any clean way to handle this and close and re-open the pool? Otherwise I have to have a daemon monitor my service and reboot the entire application if there is a temporary loss of connectivity.

Tested on RHEL 6.5 x64 with DSDriver package V10.5.0.2

Informix Connection String

Hi, how are you?
Can you send me the Informix connection string structure for ibm_db. I'm traying with the DB2 Connection string but dont work.

When i run the app shows:
Violación de segmento (Segmentation fault)

Thanks.

Andrés

problem with date values in Windows

Hi,

I'm getting problems with date values, it's saved with milliseconds in DB2, but in JS it's returning with just 000 milliseconds.

in DB2 : 2014-10-09T01:38:41.123Z

in JS : 2014-10-09T01:38:41.000Z

Can't install successfully

Hi.
I'm trying to install the library.
I'm download a driver from https://www-01.ibm.com/marketing/iwm/iwm/web/reg/download.do?source=swg-idsdpds&lang=en_US&S_PKG=li_ip64&cp=UTF-8 (the name of the file is ibm_data_server_driver_package_linuxppc64_v10.5.tar.gz).
After download I run the command ./installDSdriver
Then I run the command export IBM_DB_HOME=/home/juan/dsdriver
By last I'm run npm install ibm_db --save and getting the next message:

[email protected] install /home/juan/node/prueba_db2_1/node_modules/ibm_db
node installer/driverInstall.js

IBM_DB_HOME environment variable have already been set to /home/juan/dsdriver
make: Entering directory '/home/juan/node/prueba_db2_1/node_modules/ibm_db/build'
CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
CXX(target) Release/obj.target/odbc_bindings/src/odbc_connection.o
CXX(target) Release/obj.target/odbc_bindings/src/odbc_statement.o
CXX(target) Release/obj.target/odbc_bindings/src/odbc_result.o
CXX(target) Release/obj.target/odbc_bindings/src/dynodbc.o
SOLINK_MODULE(target) Release/obj.target/odbc_bindings.node
odbc_bindings.target.mk:126: recipe for target 'Release/obj.target/odbc_bindings.node' failed
make: Leaving directory '/home/juan/node/prueba_db2_1/node_modules/ibm_db/build'

{ [Error: Command failed: ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_Open(uv_work_t_)’:
../src/odbc_connection.cpp:239:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(SQLPOINTER)timeOut, //ValuePtr
^
../src/odbc_connection.cpp: In static member function ‘static v8::Handlev8::Value ODBCConnection::OpenSync(const v8::Arguments&)’:
../src/odbc_connection.cpp:365:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(SQLPOINTER)timeOut, //ValuePtr
^
../src/odbc_connection.cpp: In static member function ‘static v8::Handlev8::Value ODBCConnection::Query(const v8::Arguments&)’:
../src/odbc_connection.cpp:758:21: warning: variable ‘optionNoResultsKey’ set but not used [-Wunused-but-set-variable]
Local optionNoResultsKey = NanNew(OPTION_NORESULTS);
^
/usr/bin/ld: se salta el /home/juan/dsdriver/lib/libdb2.so incompatible mientras se busca -ldb2
/usr/bin/ld: no se puede encontrar -ldb2
collect2: error: ld returned 1 exit status
make: *_* [Release/obj.target/odbc_bindings.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.16.0-4-amd64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/home/juan/dsdriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=false"
gyp ERR! cwd /home/juan/node/prueba_db2_1/node_modules/ibm_db
gyp ERR! node -v v0.10.32
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
] killed: false, code: 1, signal: null }

npm ERR! [email protected] install: node installer/driverInstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node installer/driverInstall.js
npm ERR! You can get their info via:
npm ERR! npm owner ls ibm_db
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.16.0-4-amd64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "ibm_db" "--save"
npm ERR! cwd /home/juan/node/prueba_db2_1
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

I'm working on a Debian Jessie 64 bits.
Wish you can help me.

No error on querying closed connection

Hi,

I have been using the Node-RED dashdb node that uses this library, and it will start to loose data when the connection times out to the dashDB database.

I modified the code, and found that I can still send insert queries to the database even after I have explicitly closed the connection without getting any errors.

DB2 z/OS Connection: Connection and Error undefined

Good morning,

after trying to connect to an DB2 z/OS Instance I ran first into the license error, so I installed the license files under /node_modules/ibm_db/installer/clidriver/license and removed the download + untar of the fresh driver in the driverInstaller.js, removed the build/Release folder and executed the build again.

Now the license error was gone, but I didn't receive an connection object or an error object from the function, so I tried to send an invalid connection string. That worked again, receiving the appropriate error message (invalid user, ...).

My Connection String:

db.open("DRIVER={DB2};HOSTNAME=172.16.39.12;UID=DB2;PWD=<PASSWORD>;DATABASE=ZOS;PORT=446;PROTOCOL=TCPIP;", function (err,conn) {
        console.log(conn);
        console.log(err);
});

Debug Messages:

ODBC::Init
ODBCResult::Init
ODBCConnection::Init
ODBCStatement::Init
ODBC::New
ODBC::CreateConnection
ODBC::UV_CreateConnection
ODBC::UV_AfterCreateConnection
ODBCConnection::New
{ loginTimeout: 0, connectTimeout: 30, connected: true } (odbc.js: log from conn variable L152 )
ODBCConnection::Open
ODBCConnection::UV_Open
ODBCConnection::UV_Open : connectTimeout=30, loginTimeout = 0
ODBCConnection::UV_AfterOpen
undefined (odbc.js: log result in self.conn.open)
undefined (main.js: db.open -> log conn)
undefined (main.js: db.open -> log err)

Now I confused about:

  • Did I install the license correct?
  • What could I try otherwise?
  • Is my connection string faulty?

Best Regards,
Daniel

Trusted context support

Is it possible to switch users on a trusted context connection using something like SQLSetConnectAttr in CLI/ODBC applications?

Thanks

Error when running the driver: "*** stack smashing detected ***: node terminated "

I've just downloaded and built the module. Then I run this simple example:

 ibmdb = require("ibm_db");

 ibmdb.open("DRIVER={DB2};SERVER=192.168.1.211;UID=xxx;PWD=xxx;DATABASE=SAMPLE;PORT=50000;PROTOCOL=TCPIP", function(err, conn) {
   if (err) {
      return console.log(err);
   } else {
   console.log("Connection succesful");
   conn.close(function() {
      return console.log("Connection Closed");
   });
  }
});

And the result is this error:

 *** stack smashing detected ***: node terminated  
 Aborted

What is going wrong?

Trying to insert decimal datatype - not working, but no error either

Hello,

I have the following table:

create table my.dectest (d decimal(3,2));

After preparing a simple insert statement, insert into my.dectest values(?);
I have the following piece of code to insert a value into it:
stmt.execute([100.3], function (err, result) {
if (err) {
console.log(service+": Insert failed: "+err);
} else {
console.log(service+": Insert successful!");
db.commitTransaction(function(err){
if (err) {
console.log(service+": Error during commit: " + err);
}
else {
console.log(service+": Commit successful");
}
});
result.closeSync();
}
});

However, the value doesn't get into the table, and the (err) is not triggered, so I don't know what might have happened.
I also noticed (err) is not triggered in other conditions too, such as the table not existing -- still reports the insert as successful.

If anyone has a suggestion about what might be wrong or how I can get more information, I would appreciate it. Thanks.

Symbol not found: _SQLAllocHandle on Mac OS X 10.10

Hi,

I've followed the instructions and some guides for Mac OS X, also set the proper environment variables, and the installation was fine :

#etc/profile

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export IBM_DB_HOME=/Users/devniel/sqllib
#export IBM_DB_HOME=/opt/dsdriver <-- also tried
#export IBM_DB_HOME=/opt/IBM/db2/V10.1 <-- also tried
export C_INCLUDE_PATH=$IBM_DB_HOME/include:$IBM_DB_HOME/lib
export CPLUS_INCLUDE_PATH=$IBM_DB_HOME/include:$IBM_DB_HOME/lib
export DYLD_LIBRARY_PATH=$IBM_DB_HOME/lib64
export LD_LIBRARY_PATH=$IBM_DB_HOME/lib64
source /Users/devniel/sqllib/db2profile

But after the first use of ibm_db to interact with my DB2, the application that use the module crashed with the following message :

Express app started on port: 3000
INDEX ========
dyld: lazy symbol binding failed: Symbol not found: _SQLAllocHandle
  Referenced from: /Users/devniel/dev/Pon.de.tu.parte/node_modules/ibm_db/build/Release/odbc_bindings.node
  Expected in: dynamic lookup

dyld: Symbol not found: _SQLAllocHandle
  Referenced from: /Users/devniel/dev/Pon.de.tu.parte/node_modules/ibm_db/build/Release/odbc_bindings.node
  Expected in: dynamic lookup

Trace/BPT trap: 5

I have googled about four hours, but can't solve this yet .

https://code.google.com/p/ibm-db/issues/detail?id=160

http://stackoverflow.com/questions/22183165/npm-install-odbc-fails-on-osx-and-ubuntu/25748907#25748907

https://code.google.com/p/ibm-db/issues/detail?id=126

https://groups.google.com/forum/#!topic/ibm_db/FYMNsGJH2yA

Please, need your help.

Thanks

Can't install on ubuntu X86_64.

I am having the following error when trying to install on ubuntu 12.04.4LTS (GNU/Linux 3.2.0-64-virtual x86_64).

[email protected] preinstall /home/ciuser/ci_ming/dbaccess/node_modules/ibm_db
node-gyp configure build

gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack at Object.self.commands.(anonymous function) as install
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:720:7)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at maybeClose (child_process.js:994:16)
gyp ERR! stack at Socket. (child_process.js:1162:11)
gyp ERR! stack at Socket.emit (events.js:107:17)
gyp ERR! stack at Pipe.close (net.js:461:12)
gyp ERR! System Linux 3.2.0-64-virtual
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/ciuser/ci_ming/dbaccess/node_modules/ibm_db
gyp ERR! node -v v0.11.14-pre
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! [email protected] preinstall: node-gyp configure build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls ibm_db
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-64-virtual
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "ibm_db"
npm ERR! cwd /home/ciuser/ci_ming/dbaccess
npm ERR! node -v v0.11.14-pre
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ciuser/ci_ming/dbaccess/npm-debug.log
npm ERR! not ok code 0

I "export IBM_DB_HOME=/opt/ibm/db2/V10.5" prior to running npm install.

Any idea on what is going on?

Thank you!

Issues with installing for node 0.12

Hi,

I have recently upgraded from node 0.10X to the newest stable release 0.12. However, it appears that the module is broken when attempting to install the module. The troubling line appears to be node-gyp build.

an excerpt of the output is included

In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:63:38: error: expected class-name before ‘{’ token
In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:92:36: error: ‘Arguments’ does not name a type
../src/odbc.h:92:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc.h:95:49: error: ‘Arguments’ does not name a type
../src/odbc.h:95:60: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc.h:102:53: error: ‘Arguments’ does not name a type
../src/odbc.h:102:64: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
In file included from ../src/odbc.cpp:26:0:
../src/odbc_connection.h:21:48: error: expected class-name before ‘{’ token
../src/odbc_connection.h:43:36: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:43:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:46:72: error: ‘AccessorInfo’ does not name a type
../src/odbc_connection.h:46:86: error: ISO C++ forbids declaration of ‘info’ with no type [-fpermissive]
../src/odbc_connection.h:47:77: error: ‘AccessorInfo’ does not name a type
../src/odbc_connection.h:47:91: error: ISO C++ forbids declaration of ‘info’ with no type [-fpermissive]
../src/odbc_connection.h:48:88: error: ‘AccessorInfo’ does not name a type
../src/odbc_connection.h:48:102: error: ISO C++ forbids declaration of ‘info’ with no type [-fpermissive]
../src/odbc_connection.h:51:49: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:51:60: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:55:47: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:55:58: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:59:37: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:59:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:63:38: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:63:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:67:48: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:67:59: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:71:38: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:71:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:75:40: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:75:51: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:78:39: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:78:50: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:82:42: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:82:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:83:52: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:83:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:84:41: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:84:52: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:85:42: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:85:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:86:53: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:86:64: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h:87:51: error: ‘Arguments’ does not name a type
../src/odbc_connection.h:87:62: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_connection.h: In constructor ‘ODBCConnection::ODBCConnection(HENV, HDBC)’:
../src/odbc_connection.h:36:7: error: class ‘ODBCConnection’ does not have any field named ‘ObjectWrap’
In file included from ../src/odbc.cpp:27:0:
../src/odbc_result.h: At global scope:
../src/odbc_result.h:20:44: error: expected class-name before ‘{’ token
../src/odbc_result.h:41:36: error: ‘Arguments’ does not name a type
../src/odbc_result.h:41:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:44:38: error: ‘Arguments’ does not name a type
../src/odbc_result.h:44:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:48:41: error: ‘Arguments’ does not name a type
../src/odbc_result.h:48:52: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:53:42: error: ‘Arguments’ does not name a type
../src/odbc_result.h:53:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:54:48: error: ‘Arguments’ does not name a type
../src/odbc_result.h:54:59: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:55:42: error: ‘Arguments’ does not name a type
../src/odbc_result.h:55:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:56:45: error: ‘Arguments’ does not name a type
../src/odbc_result.h:56:56: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:57:51: error: ‘Arguments’ does not name a type
../src/odbc_result.h:57:62: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_result.h:60:72: error: ‘AccessorInfo’ does not name a type
../src/odbc_result.h:60:86: error: ISO C++ forbids declaration of ‘info’ with no type [-fpermissive]
../src/odbc_result.h:61:83: error: ‘AccessorInfo’ does not name a type
../src/odbc_result.h:61:97: error: ISO C++ forbids declaration of ‘info’ with no type [-fpermissive]
../src/odbc_result.h: In constructor ‘ODBCResult::ODBCResult(HENV, HDBC, HSTMT, bool)’:
../src/odbc_result.h:32:7: error: class ‘ODBCResult’ does not have any field named ‘ObjectWrap’
In file included from ../src/odbc.cpp:28:0:
../src/odbc_statement.h: At global scope:
../src/odbc_statement.h:20:47: error: expected class-name before ‘{’ token
../src/odbc_statement.h:39:36: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:39:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:42:40: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:42:51: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:46:46: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:46:57: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:50:48: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:50:59: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:54:40: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:54:51: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:58:37: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:58:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:63:42: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:63:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:64:44: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:64:55: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:65:50: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:65:61: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:66:52: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:66:63: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:67:44: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:67:55: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h:68:41: error: ‘Arguments’ does not name a type
../src/odbc_statement.h:68:52: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/odbc_statement.h: In constructor ‘ODBCStatement::ODBCStatement(HENV, HDBC, HSTMT)’:
../src/odbc_statement.h:31:7: error: class ‘ODBCStatement’ does not have any field named ‘ObjectWrap’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static void ODBC::Init(v8::Handle<v8::Object>)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:48:15: error: within this context
../src/odbc.cpp:50:56: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
../src/odbc.cpp:50:56: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3455:34: note:   no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../src/odbc.cpp:53:61: error: no matching function for call to ‘v8::Persistent<v8::FunctionTemplate>::New(v8::Local<v8::FunctionTemplate>&)’
../src/odbc.cpp:53:61: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5809:4: note: static T* v8::PersistentBase<T>::New(v8::Isolate*, T*) [with T = v8::FunctionTemplate]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5809:4: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:54:23: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:54:38: error: ‘NewSymbol’ is not a member of ‘v8::String’
../src/odbc.cpp:57:65: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:61:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:62:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:63:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:64:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:65:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:66:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:67:3: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:70:87: error: could not convert ‘ODBC::constructor_template’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/odbc.cpp:71:95: error: could not convert ‘ODBC::constructor_template’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/odbc.cpp:74:16: error: ‘NewSymbol’ is not a member of ‘v8::String’
../src/odbc.cpp:75:36: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:77:9: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:77:25: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
../src/odbc.cpp:83:39: error: invalid conversion from ‘void (*)(uv_async_t*, int) {aka void (*)(uv_async_s*, int)}’ to ‘uv_async_cb {aka void (*)(uv_async_s*)}’ [-fpermissive]
/home/neilson/.node-gyp/0.12.0/deps/uv/include/uv.h:720:15: error:   initializing argument 3 of ‘int uv_async_init(uv_loop_t*, uv_async_t*, uv_async_cb)’ [-fpermissive]
../src/odbc.cpp: At global scope:
../src/odbc.cpp:118:31: error: ‘Arguments’ does not name a type
../src/odbc.cpp:118:42: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::New(const int&)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:120:15: error: within this context
../src/odbc.cpp:123:8: error: ‘class ODBC’ has no member named ‘Wrap’
../src/odbc.cpp:123:18: error: request for member ‘Holder’ in ‘args’, which is of non-class type ‘const int’
../src/odbc.cpp:137:28: error: ‘ThrowException’ was not declared in this scope
../src/odbc.cpp:142:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:142:27: error: request for member ‘Holder’ in ‘args’, which is of non-class type ‘const int’
../src/odbc.cpp: At global scope:
../src/odbc.cpp:154:44: error: ‘Arguments’ does not name a type
../src/odbc.cpp:154:55: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::CreateConnection(const int&)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:156:15: error: within this context
../src/odbc.cpp:158:3: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/odbc.cpp:158:3: error: invalid types ‘const int[int]’ for array subscript
../src/odbc.cpp:158:3: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:158:3: error: ‘ThrowException’ was not declared in this scope
../src/odbc.cpp:158:3: error: invalid types ‘const int[int]’ for array subscript
../src/odbc.cpp:160:15: error: ‘ObjectWrap’ has not been declared
../src/odbc.cpp:160:38: error: expected primary-expression before ‘>’ token
../src/odbc.cpp:160:45: error: request for member ‘Holder’ in ‘args’, which is of non-class type ‘const int’
../src/odbc.cpp:169:42: error: no matching function for call to ‘v8::Persistent<v8::Function>::New(v8::Local<v8::Function>&)’
../src/odbc.cpp:169:42: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5809:4: note: static T* v8::PersistentBase<T>::New(v8::Isolate*, T*) [with T = v8::Function]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5809:4: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:176:8: error: ‘class ODBC’ has no member named ‘Ref’
../src/odbc.cpp:178:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:178:32: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static void ODBC::UV_AfterCreateConnection(uv_work_t*, int)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:197:15: error: within this context
../src/odbc.cpp:208:13: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
../src/odbc.cpp:208:20: error: ‘GetCurrent’ is not a member of ‘v8::Context’
../src/odbc.cpp:212:46: error: no matching function for call to ‘v8::External::New(void*&)’
../src/odbc.cpp:212:46: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note: static v8::Local<v8::External> v8::External::New(v8::Isolate*, void*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:213:39: error: no matching function for call to ‘v8::External::New(void*&)’
../src/odbc.cpp:213:39: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note: static v8::Local<v8::External> v8::External::New(v8::Isolate*, void*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:215:65: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:218:38: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:306:28: note: declared here
../src/odbc.cpp:219:43: error: no matching function for call to ‘v8::Local<v8::Object>::New(v8::Local<v8::Object>&)’
../src/odbc.cpp:219:43: note: candidates are:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5765:10: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, v8::Handle<T>) [with T = v8::Object]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5765:10: note:   candidate expects 2 arguments, 1 provided
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5770:10: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, const v8::PersistentBase<T>&) [with T = v8::Object]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5770:10: note:   candidate expects 2 arguments, 1 provided
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5785:10: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, T*) [with T = v8::Object]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5785:10: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:221:13: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
../src/odbc.cpp:221:20: error: ‘GetCurrent’ is not a member of ‘v8::Context’
../src/odbc.cpp:229:14: error: ‘class ODBC’ has no member named ‘Unref’
../src/odbc.cpp:230:12: error: ‘class v8::Persistent<v8::Function>’ has no member named ‘Dispose’
../src/odbc.cpp:235:9: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:235:25: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
../src/odbc.cpp: At global scope:
../src/odbc.cpp:242:48: error: ‘Arguments’ does not name a type
../src/odbc.cpp:242:59: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::CreateConnectionSync(const int&)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:244:15: error: within this context
../src/odbc.cpp:246:15: error: ‘ObjectWrap’ has not been declared
../src/odbc.cpp:246:38: error: expected primary-expression before ‘>’ token
../src/odbc.cpp:246:45: error: request for member ‘Holder’ in ‘args’, which is of non-class type ‘const int’
../src/odbc.cpp:262:40: error: no matching function for call to ‘v8::External::New(void*&)’
../src/odbc.cpp:262:40: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note: static v8::Local<v8::External> v8::External::New(v8::Isolate*, void*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:263:33: error: no matching function for call to ‘v8::External::New(void*&)’
../src/odbc.cpp:263:33: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note: static v8::Local<v8::External> v8::External::New(v8::Isolate*, void*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3154:26: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:265:63: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/odbc.cpp:268:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::GetColumnValue(SQLHSTMT, Column, uint16_t*, int)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:363:15: error: within this context
../src/odbc.cpp:391:24: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:391:35: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:306:28: note: declared here
../src/odbc.cpp:395:24: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:395:48: error: no matching function for call to ‘v8::Integer::New(long int&)’
../src/odbc.cpp:395:48: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2012:25: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:422:24: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:422:35: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:306:28: note: declared here
../src/odbc.cpp:426:24: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:426:47: error: no matching function for call to ‘v8::Number::New(double&)’
../src/odbc.cpp:426:47: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:1999:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:1999:24: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:493:22: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:493:33: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:306:28: note: declared here
../src/odbc.cpp:512:22: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:513:58: error: no matching function for call to ‘v8::Date::New(double)’
../src/odbc.cpp:513:58: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3007:23: note: static v8::Local<v8::Value> v8::Date::New(v8::Isolate*, double)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:3007:23: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:535:22: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:535:33: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:306:28: note: declared here
../src/odbc.cpp:539:22: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:539:74: error: no matching function for call to ‘v8::Boolean::New(bool)’
../src/odbc.cpp:539:74: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:6194:17: note: static v8::Handle<v8::Boolean> v8::Boolean::New(v8::Isolate*, bool)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:6194:17: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:565:24: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:565:35: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:306:28: note: declared here
../src/odbc.cpp:579:19: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:587:39: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:611:13: error: ‘ThrowException’ was not declared in this scope
../src/odbc.cpp:617:20: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Local<v8::Object> ODBC::GetRecordTuple(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:629:15: error: within this context
../src/odbc.cpp:631:37: error: no matching function for call to ‘v8::Object::New()’
../src/odbc.cpp:631:37: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:24: note:   candidate expects 1 argument, 0 provided
../src/odbc.cpp:635:17: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:644:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::GetRecordArray(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:654:15: error: within this context
../src/odbc.cpp:656:35: error: no matching function for call to ‘v8::Array::New()’
../src/odbc.cpp:656:35: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2417:23: note: static v8::Local<v8::Array> v8::Array::New(v8::Isolate*, int)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2417:23: note:   candidate expects 2 arguments, 0 provided
../src/odbc.cpp:659:31: error: no matching function for call to ‘v8::Integer::New(int&)’
../src/odbc.cpp:659:31: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2012:25: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:664:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, v8::Persistent<v8::Function>)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:781:15: error: within this context
../src/odbc.cpp:783:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, char*, v8::Persistent<v8::Function>)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:794:15: error: within this context
../src/odbc.cpp:804:5: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
../src/odbc.cpp:804:12: error: ‘GetCurrent’ is not a member of ‘v8::Context’
../src/odbc.cpp:806:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/odbc.cpp:806:32: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:305:28: note: declared here
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:814:15: error: within this context
../src/odbc.cpp:816:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE, char*)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:823:15: error: within this context
../src/odbc.cpp:827:40: error: no matching function for call to ‘v8::Object::New()’
../src/odbc.cpp:827:40: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:24: note:   candidate expects 1 argument, 0 provided
../src/odbc.cpp:868:21: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:868:43: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:870:47: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:871:21: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:871:45: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:872:21: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:872:43: error: ‘New’ is not a member of ‘v8::String’
../src/odbc.cpp:883:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static v8::Local<v8::Array> ODBC::GetAllRecordsSync(HENV, HDBC, HSTMT, uint16_t*, int)’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/odbc.cpp:897:15: error: within this context
../src/odbc.cpp:899:40: error: no matching function for call to ‘v8::Object::New()’
../src/odbc.cpp:899:40: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2388:24: note:   candidate expects 1 argument, 0 provided
../src/odbc.cpp:907:34: error: no matching function for call to ‘v8::Array::New()’
../src/odbc.cpp:907:34: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2417:23: note: static v8::Local<v8::Array> v8::Array::New(v8::Isolate*, int)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2417:23: note:   candidate expects 2 arguments, 0 provided
../src/odbc.cpp:937:25: error: no matching function for call to ‘v8::Integer::New(int&)’
../src/odbc.cpp:937:25: note: candidate is:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:2012:25: note:   candidate expects 2 arguments, 1 provided
../src/odbc.cpp:950:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
In file included from ../src/odbc.cpp:19:0:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h: In static member function ‘static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object, T = v8::Function]’:
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:592:5:   instantiated from ‘static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>, T = v8::Function, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Function>]’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:5826:3:   instantiated from ‘void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Function, M2 = v8::NonCopyablePersistentTraits<v8::Function>, T = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>]’
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:657:5:   instantiated from ‘v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>, v8::Persistent<T, M> = v8::Persistent<v8::Function>]’
../src/odbc.cpp:787:7:   instantiated from here
/home/neilson/.node-gyp/0.12.0/deps/v8/include/v8.h:596:5: error: cannot convert ‘v8::Primitive*’ to ‘v8::Object* volatile’ in assignment
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Array> ODBC::GetAllRecordsSync(HENV, HDBC, HSTMT, uint16_t*, int)’:
../src/odbc.cpp:951:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE, char*)’:
../src/odbc.cpp:884:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetSQLError(SQLSMALLINT, SQLHANDLE)’:
../src/odbc.cpp:820:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, char*, v8::Persistent<v8::Function>)’:
../src/odbc.cpp:807:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, v8::Persistent<v8::Function>)’:
../src/odbc.cpp:788:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetRecordArray(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
../src/odbc.cpp:665:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Local<v8::Object> ODBC::GetRecordTuple(SQLHSTMT, Column*, short int*, uint16_t*, int)’:
../src/odbc.cpp:645:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetColumnValue(SQLHSTMT, Column, uint16_t*, int)’:
../src/odbc.cpp:620:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CreateConnectionSync(const int&)’:
../src/odbc.cpp:269:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::CreateConnection(const int&)’:
../src/odbc.cpp:179:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::New(const int&)’:
../src/odbc.cpp:143:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
make: Leaving directory `/home/neilson/dst2/NodeOrchestrator/node_modules/ibm_db/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2

core dumped on SQL error

When trying to add a row with a preexisting primary key, instead of returning an SQL error (that should be code -803) the program terminates with the following msg:

*** stack smashing detected ***: node terminated
Aborted (core dumped)

I'm using node v0.10.32, and DB2 Server and client both version 10.5.

Please let me know if you need further information to confirm the issue.

0.0.12 fails to install on IBM Bluemix

Hi,

as of the 0.0.12 release, the node-red boilerplate on IBM Bluemix no longer installs. It fails with:

2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! [email protected] install: `node installer/driverInstall.js`
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! Exit status 1
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR!
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! Failed at the [email protected] install script.
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! This is most likely a problem with the ibm_db package,
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! not with npm itself.
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! Tell the author that this fails on your system:
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR!     node installer/driverInstall.js
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! You can get their info via:
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR!     npm owner ls ibm_db
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! There is likely additional logging output above.
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! System Linux 3.13.0-39-generic
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! command "/tmp/staged/app/vendor/node/bin/node" "/tmp/staged/app/vendor/node/bin/npm" "install" "--unsafe-perm" "--quiet" "--userconfig" "/tmp/staged/app/.npmrc"
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! cwd /tmp/staged/app
2015-07-31T14:43:03.22+0100 [STG/0]      OUT        npm ERR! node -v v0.10.40
2015-07-31T14:43:03.23+0100 [STG/0]      OUT        npm ERR! npm -v 1.4.28
2015-07-31T14:43:03.23+0100 [STG/0]      OUT        npm ERR! code ELIFECYCLE
2015-07-31T14:43:03.36+0100 [STG/0]      OUT        npm ERR! not ok code 0
2015-07-31T14:43:03.40+0100 [STG/0]      OUT -----> Build failed
2015-07-31T14:43:03.42+0100 [STG/0]      OUT Staging failed: Buildpack compilation step failed
2015-07-31T14:43:03.42+0100 [STG/0]      ERR
2015-07-31T14:43:03.67+0100 [API/5]      ERR encountered error: App staging failed in the buildpack compile phase

Close connection problem

Sometime an error occures when I try to close a connection after executing a query (open the connection, execute the query, close the connection).
The error is thrown at this line: https://github.com/ibmdb/node-ibm_db/blob/master/lib/odbc.js#L161
At some point, the "self.conn" seems to be empty, so it cannot be closed.
To make the code working, I used the following work-around:

self.conn && self.conn.close && self.conn.close(...);

I don't know why this error happens but a pre-check should be done before calling the close method on an undefined connection.

If a PR is needed, please tell me and I'll do it.

Informix 10.0 Connection Error

Hi,

Thanks a lot for this module.

I'm having the following issue when trying to connect to an informix 10.0 server:

[IBM][CLI Driver] SQL30082N Security processing failed with reason "17" ("UNSUPPORTED FUNCTION"). SQLSTATE=08001

Using the following DSN:
Database=myDataBase;Host=192.168.10.10;Server=db_engine_tcp;Service=1492;
Protocol=onsoctcp;UID=myUsername;Password=myPassword;

Does it support Informix V10.0?
In case it does, what I'm doing wrong? With jdbc / php-pdo it's working fine.

Thanks in advance,

tryqwe

Issue when connecting to IBM DB2 hosted on IBM Bluemix

I am trying to use your ibm_db module for Node JS to connect to an IBM DB2 hosted on IBM Bluemix. The version of the database is DB2LUW 10.5.4.

When I try to insert data into a table, I get the following error response:

{"error":"[node-odbc] SQL_ERROR","message":"[IBM][CLI Driver] CLI0123E SQL data type out of range. SQLSTATE=HY004","state":"HY004"}

Is this module compatible with the 10.5.4 release of IBM DB2?

npm install failing on mac osx yosemite

npm install is failing as shown below

mpro:~ saboji$ npm install ibm_db

[email protected] install /Users/saboji/node_modules/ibm_db
node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...
Download and extraction of DB2 ODBC CLI Driver completed successfully ...
CXX(target) Release/obj.target/odbc_bindings/src/odbc.o

{ [Error: Command failed: /bin/sh -c node-gyp configure build --IBM_DB_HOME=$IBM_DB_HOME --IBM_DB_HOME_WIN=%IBM_DB_HOME% --IS_DOWNLOADED=true
In file included from ../src/odbc.cpp:25:
../src/odbc.h:76:85: error: unknown type name 'NanCallback'
static Handle CallbackSQLError(SQLSMALLINT handleType, SQLHANDLE handle, NanCallback* cb);
^
../src/odbc.h:77:101: error: unknown type name 'NanCallback'
static Handle CallbackSQLError (SQLSMALLINT handleType, SQLHANDLE handle, char* message, NanCallback* cb);
^
../src/odbc.h:112:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
In file included from ../src/odbc.cpp:26:
../src/odbc_connection.h:95:7: error: unknown type name 'NanCallback'
NanCallback* callback;
^
../src/odbc_connection.h:113:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc_connection.h:120:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc_connection.h:143:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc_connection.h:151:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
In file included from ../src/odbc.cpp:27:
../src/odbc_result.h:66:7: error: unknown type name 'NanCallback'
NanCallback* cb;
^
In file included from ../src/odbc.cpp:28:
../src/odbc_statement.h:73:7: error: unknown type name 'NanCallback'
NanCallback* callback;
^
../src/odbc_statement.h:95:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc_statement.h:103:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc_statement.h:109:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc_statement.h:117:3: error: unknown type name 'NanCallback'
NanCallback* cb;
^
../src/odbc.cpp:48:3: error: use of undeclared identifier 'NanScope'
NanScope();
^
../src/odbc.cpp:50:50: error: use of undeclared identifier 'NanNew'
Local constructor_template = NanNew(New);
^
../src/odbc.cpp:50:57: error: 'FunctionTemplate' does not refer to a value
Local constructor_template = NanNew(New);
^
/Users/saboji/.node-gyp/0.12.7/deps/v8/include/v8.h:3452:17: note: declared here
class V8_EXPORT FunctionTemplate : public Template {
^
../src/odbc.cpp:53:38: error: use of undeclared identifier 'NanNew'
constructor_template->SetClassName(NanNew("ODBC"));
^
../src/odbc.cpp:66:29: error: use of undeclared identifier 'NanNew'
constructor_template->Set(NanNew("SQL_CLOSE"), NanNew(SQL_CLOSE), constant_attributes);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/Users/saboji/node_modules/ibm_db/installer/clidriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=true"
gyp ERR! cwd /Users/saboji/node_modules/ibm_db
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
]
killed: false,
code: 1,
signal: null,
cmd: '/bin/sh -c node-gyp configure build --IBM_DB_HOME=$IBM_DB_HOME --IBM_DB_HOME_WIN=%IBM_DB_HOME% --IS_DOWNLOADED=true' }
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "ibm_db"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node installer/driverInstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node installer/driverInstall.js'.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node installer/driverInstall.js
npm ERR! You can get their info via:
npm ERR! npm owner ls ibm_db
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/saboji/npm-debug.log

Crashes on Windows 7 64-bit if a bad connection string is given

On Windows 7 64-bit, using the pre-built binaries, if I use a correct connection string such as

DRIVER={DB2};DATABASE=MBRECORD;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=username;PWD=password

then ibm_db behaves as normally. If I alter the connection string so that the target hostname and port is not a DB2 database, for example

DRIVER={DB2};DATABASE=MBRECORD;HOSTNAME=localhost;PORT=49999;PROTOCOL=TCPIP;UID=username;PWD=password

then Node.js crashes when ibm_db.open(dsnString, function(err, conn) { ... }) is called:

stop

This should never happen, ibm_db should fail gracefully with a useful error message no matter what.

Prepared statement missing result?

For given example I get result = {"fetchMode":4}
Where is the data? If I user conn.query i get result data as expected.

pool.open(connectionString, function (err, conn) {
        conn.prepare(query, function (err, stmt) {
            if (err) {
                console.error('error: ', err.message);
                return conn.close(function (err) { });
            } else {
                stmt.execute(parameters, function (err, result) {
                    console.log(err); // no error
                    console.log(result); // {"fetchMode":4}

                    if (err) {
                        console.error('error: ', err.message);
                    }

                    result.closeSync();
                    conn.close(function (err) { });
                });
            }
        });
    });

npm install ibm_db2 returns 404

running " npm install ibm_db2" yields:

npm ERR! 404 Not Found: ibm_db2
npm ERR! 404
npm ERR! 404 'ibm_db2' is not in the npm registry.

Is this your problem or theirs? Or ours?

Can't start node-red application with ibm_db error

Hi, from yesterday I can't start my NodeRed application which works with dashDB using ibm_db library with '0.x' in package.json. All the time I'm getting error:

[email protected] install /tmp/staged/app/node_modules/ibm_db
node installer/driverInstall.js
IBM_DB_HOME environment variable have already been set to /tmp/staged/app/clidriver
make: Entering directory /tmp/staged/app/node_modules/ibm_db/build' CXX(target) Release/obj.target/odbc_bindings/src/odbc.o make: Leaving directory/tmp/staged/app/node_modules/ibm_db/build'
{ [Error: Command failed: In file included from ../src/odbc.cpp:25:
../src/odbc.h:76: error: 'NanCallback' has not been declared
../src/odbc.h:77: error: 'NanCallback' has not been declared
../src/odbc.h:112: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc.h:112: error: expected ';' before '' token
In file included from ../src/odbc.cpp:26:
../src/odbc_connection.h:95: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_connection.h:95: error: expected ';' before '
' token
../src/odbc_connection.h:113: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_connection.h:113: error: expected ';' before '' token
../src/odbc_connection.h:120: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_connection.h:120: error: expected ';' before '
' token
../src/odbc_connection.h:143: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_connection.h:143: error: expected ';' before '' token
../src/odbc_connection.h:151: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_connection.h:151: error: expected ';' before '
' token
In file included from ../src/odbc.cpp:27:
../src/odbc_result.h:66: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_result.h:66: error: expected ';' before '' token
In file included from ../src/odbc.cpp:28:
../src/odbc_statement.h:73: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_statement.h:73: error: expected ';' before '
' token
../src/odbc_statement.h:95: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_statement.h:95: error: expected ';' before '' token
../src/odbc_statement.h:103: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_statement.h:103: error: expected ';' before '
' token
../src/odbc_statement.h:109: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_statement.h:109: error: expected ';' before '' token
../src/odbc_statement.h:117: error: ISO C++ forbids declaration of 'NanCallback' with no type
../src/odbc_statement.h:117: error: expected ';' before '
' token
../src/odbc.cpp: In static member function 'static void ODBC::Init(v8::Handlev8::Object)':
../src/odbc.cpp:48: error: 'NanScope' was not declared in this scope
../src/odbc.cpp:50: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:50: error: expected primary-expression before '>' token
../src/odbc.cpp:66: error: expected primary-expression before '>' token
../src/odbc.cpp:66: error: expected primary-expression before '>' token
../src/odbc.cpp:67: error: expected primary-expression before '>' token
../src/odbc.cpp:67: error: expected primary-expression before '>' token
../src/odbc.cpp:68: error: expected primary-expression before '>' token
../src/odbc.cpp:68: error: expected primary-expression before '>' token
../src/odbc.cpp:69: error: expected primary-expression before '>' token
../src/odbc.cpp:69: error: expected primary-expression before '>' token
../src/odbc.cpp:70: error: expected primary-expression before '>' token
../src/odbc.cpp:70: error: expected primary-expression before '>' token
../src/odbc.cpp:71: error: expected primary-expression before '>' token
../src/odbc.cpp:71: error: expected primary-expression before '>' token
../src/odbc.cpp:72: error: expected primary-expression before '>' token
../src/odbc.cpp:72: error: expected primary-expression before '>' token
../src/odbc.cpp:75: error: no matching function for call to 'SetPrototypeMethod(v8::Localv8::FunctionTemplate&, const char [17], Nan::NAN_METHOD_RETURN_TYPE (&)(const Nan::FunctionCallbackInfov8::Value&))'
../src/odbc.cpp:76: error: no matching function for call to 'SetPrototypeMethod(v8::Localv8::FunctionTemplate&, const char [21], Nan::NAN_METHOD_RETURN_TYPE (&)(const Nan::FunctionCallbackInfov8::Value&))'
../src/odbc.cpp:79: error: 'NanAssignPersistent' was not declared in this scope
../src/odbc.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE ODBC::New(const Nan::FunctionCallbackInfov8::Value&)':
../src/odbc.cpp:124: error: 'NanScope' was not declared in this scope
../src/odbc.cpp:127: error: 'args' was not declared in this scope
../src/odbc.cpp:143: error: 'NanThrowError' was not declared in this scope
../src/odbc.cpp:143: error: return-statement with a value, in function returning 'void'
../src/odbc.cpp:149: error: 'NanReturnValue' was not declared in this scope
../src/odbc.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE ODBC::CreateConnection(const Nan::FunctionCallbackInfov8::Value&)':
../src/odbc.cpp:163: error: 'NanScope' was not declared in this scope
../src/odbc.cpp:165: error: 'args' was not declared in this scope
../src/odbc.cpp:165: error: expected primary-expression before '>' token
../src/odbc.cpp:165: error: expected primary-expression before ')' token
../src/odbc.cpp:166: error: 'NanCallback' was not declared in this scope
../src/odbc.cpp:166: error: 'callback' was not declared in this scope
../src/odbc.cpp:166: error: expected type-specifier before 'NanCallback'
../src/odbc.cpp:166: error: expected ';' before 'NanCallback'
../src/odbc.cpp:178: error: 'struct create_connection_work_data' has no member named 'cb'
../src/odbc.cpp:187: error: 'NanUndefined' was not declared in this scope
../src/odbc.cpp:187: error: 'NanReturnValue' was not declared in this scope
../src/odbc.cpp:165: warning: unused variable 'cb'
../src/odbc.cpp: In static member function 'static void ODBC::UV_AfterCreateConnection(uv_work_t_, int)':
../src/odbc.cpp:206: error: 'NanScope' was not declared in this scope
../src/odbc.cpp:217: error: 'struct create_connection_work_data' has no member named 'cb'
../src/odbc.cpp:221: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:221: error: expected primary-expression before '>' token
../src/odbc.cpp:222: error: expected primary-expression before '>' token
../src/odbc.cpp:224: error: expected primary-expression before '>' token
../src/odbc.cpp:226: error: expected primary-expression before '>' token
../src/odbc.cpp:226: error: 'NanNull' was not declared in this scope
../src/odbc.cpp:229: error: 'struct create_connection_work_data' has no member named 'cb'
../src/odbc.cpp:238: error: 'struct create_connection_work_data' has no member named 'cb'
../src/odbc.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE ODBC::CreateConnectionSync(const Nan::FunctionCallbackInfov8::Value&)':
../src/odbc.cpp:250: error: 'NanScope' was not declared in this scope
../src/odbc.cpp:252: error: 'args' was not declared in this scope
../src/odbc.cpp:268: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:268: error: expected primary-expression before '>' token
../src/odbc.cpp:269: error: expected primary-expression before '>' token
../src/odbc.cpp:271: error: expected primary-expression before '>' token
../src/odbc.cpp:273: error: 'NanReturnValue' was not declared in this scope
../src/odbc.cpp: In static member function 'static v8::Handlev8::Value ODBC::GetColumnValue(void_, Column, uint16_t_, int)':
../src/odbc.cpp:369: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:397: error: 'NanNull' was not declared in this scope
../src/odbc.cpp:397: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:400: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:400: error: expected primary-expression before '>' token
../src/odbc.cpp:400: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:403: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:403: error: expected primary-expression before '>' token
../src/odbc.cpp:403: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:406: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:406: error: expected primary-expression before '>' token
../src/odbc.cpp:406: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:409: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:409: error: expected primary-expression before '>' token
../src/odbc.cpp:409: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:435: error: 'NanNull' was not declared in this scope
../src/odbc.cpp:435: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:439: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:439: error: expected primary-expression before '>' token
../src/odbc.cpp:439: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:506: error: 'NanNull' was not declared in this scope
../src/odbc.cpp:506: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:525: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:525: error: expected primary-expression before '>' token
../src/odbc.cpp:526: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:548: error: 'NanNull' was not declared in this scope
../src/odbc.cpp:548: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:552: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:552: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:577: error: 'NanNull' was not declared in this scope
../src/odbc.cpp:577: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:591: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:599: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:623: error: 'NanThrowError' was not declared in this scope
../src/odbc.cpp:624: error: 'NanUndefined' was not declared in this scope
../src/odbc.cpp:624: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp:629: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: In static member function 'static v8::Localv8::Object ODBC::GetRecordTuple(void_, Column_, short int_, uint16_t_, int)':
../src/odbc.cpp:640: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:642: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:642: error: expected primary-expression before '>' token
../src/odbc.cpp:642: error: expected primary-expression before ')' token
../src/odbc.cpp:654: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: In static member function 'static v8::Handlev8::Value ODBC::GetRecordArray(void_, Column_, short int_, uint16_t_, int)':
../src/odbc.cpp:664: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:666: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:666: error: expected primary-expression before '>' token
../src/odbc.cpp:666: error: expected primary-expression before ')' token
../src/odbc.cpp:673: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: At global scope:
../src/odbc.cpp:789: error: 'NanCallback' has not been declared
../src/odbc.cpp: In static member function 'static v8::Handlev8::Value ODBC::CallbackSQLError(SQLSMALLINT, void_, int_)':
../src/odbc.cpp:790: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:796: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: At global scope:
../src/odbc.cpp:802: error: 'NanCallback' has not been declared
../src/odbc.cpp: In static member function 'static v8::Handlev8::Value ODBC::CallbackSQLError(SQLSMALLINT, void_, char_, int_)':
../src/odbc.cpp:803: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:813: error: request for member 'Call' in '* cb', which is of non-class type 'int'
../src/odbc.cpp:815: error: 'NanUndefined' was not declared in this scope
../src/odbc.cpp:815: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: In static member function 'static v8::Localv8::Object ODBC::GetSQLError(SQLSMALLINT, void_)':
../src/odbc.cpp:823: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:828: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: In static member function 'static v8::Localv8::Object ODBC::GetSQLError(SQLSMALLINT, void_, char_)':
../src/odbc.cpp:832: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:836: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:836: error: expected primary-expression before '>' token
../src/odbc.cpp:836: error: expected primary-expression before ')' token
../src/odbc.cpp:858: error: expected primary-expression before '>' token
../src/odbc.cpp:858: error: expected primary-expression before ')' token
../src/odbc.cpp:894: error: 'NanEscapeScope' was not declared in this scope
../src/odbc.cpp: In static member function 'static v8::Localv8::Array ODBC::GetAllRecordsSync(void_, void_, void_, uint16_t*, int)':
../src/odbc.cpp:908: error: 'NanEscapableScope' was not declared in this scope
../src/odbc.cpp:910: error: 'NanNew' was not declared in this scope
../src/odbc.cpp:910: error: expected primary-expression before '>' token
../src/odbc.cpp:910: error: expected primary-expression before ')' token
../src/odbc.cpp:918: error: expected primary-expression before '>' token
gyp ERR! System Linux 3.13.0-39-generic
gyp ERR! command "node" "/tmp/staged/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/tmp/staged/app/clidriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=false"
gyp ERR! cwd /tmp/staged/app/node_modules/ibm_db
gyp ERR! node -v v0.10.38
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
] killed: false, code: 1, signal: null }
[email protected] install /tmp/staged/app/node_modules/mongodb/node_modules/bson
(node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory /tmp/staged/app/node_modules/mongodb/node_modules/bson/build' CXX(target) Release/obj.target/bson/ext/bson.o SOLINK_MODULE(target) Release/obj.target/bson.node SOLINK_MODULE(target) Release/obj.target/bson.node: Finished COPY Release/bson.node make: Leaving directory/tmp/staged/app/node_modules/mongodb/node_modules/bson/build'
[email protected] install /tmp/staged/app/node_modules/node-red/node_modules/bcrypt
node-gyp rebuild
make: Entering directory /tmp/staged/app/node_modules/node-red/node_modules/bcrypt/build' CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node: Finished COPY Release/bcrypt_lib.node make: Leaving directory/tmp/staged/app/node_modules/node-red/node_modules/bcrypt/build'
[email protected] install /tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase

Probless connecting to HADR database

When trying to access a database with HADR I receive this error:

Error: [IBM][CLI Driver] SQL1776N  The command cannot be issued on an HADR database. Reason code = "1".

Even though the reason code is 1 (The command is not supported on an HADR standby database.) I am sure I am pointing my app to the primary database because the query works normally the first time., this error only happens after the first successful request.

Also, I have no problem connecting to the same database using the DB2 PHP driver, so it doesn't look like a database base configuration issue.

Running on OS X Yosemite 10.10.3 returns error

I am getting some db2 errors with a connection module for Node.JS if I'm running it locally on my mac machine. It seems like the new version of OS X 10.10.3 changed some security features of the whole system and it now give a nice:

[IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004\n

Would you know if there is some kind of fix for the module for DB2 connections on OS X 10.10.3 (same issue on 10.10.2)?

Stored Proc gets no result! result logs as {fetchMode : 4}, rObj is an empty array, should contain the output string

//simple procedure, takes in input param, has one out param
CREATE OR REPLACE PROCEDURE PROCIMATE(IN PARM VARCHAR(30),OUT o_PARAM VARCHAR(200))
BEGIN
set o_PARAM= 'This is my | procedure| what do you say' ;
END

//javascipt code
var query = "call procimate(?,?)";

pool.acquire(function (err, conn) {
  if (err) {
    cb(httpstatus.getStatus('500', 'Error', 500, 'DB.Connection', 'Error', err.toString()));
  } else {

    conn.prepare(query, function (err, stmt) {

      if (err) {

        console.error('error: ', err.message);

        return conn.close(function (err) {
        });

      } else {

        stmt.execute(['1','?'], function (err, result) {

          if (err) console.log(err); // no error

          else {
            var rObj = result.fetchAllSync();
            console.log(rObj);
          }

          if (err) {

            console.error('error: ', err.message);

          }

          if (result) {
            result.closeSync();
          }

          conn.close(function (err) {
          });

        });

      }

    });
  }

});

node app crashes when query results in PK constraints error

Hi,

It seems that there's a problem with compound PK constraints error, in Windows and Linux, it's not returning the error in the callback, instead it turns down the node app.

In windows, it just crashes; but in Linux (well, in IBM Bluemix) it's printing the following message in the log, just in case someone got the same and search for it :

ERR *** stack smashing detected ***: node terminated
ERR /bin/bash: line 30:    32 Segmentation fault      ( node server.js )

npm install fails on xlinux - redhat 6.3

$ npm --version
1.4.3
../src/odbc.cpp:275: error: initializer expression list treated as compound expression
../src/odbc.cpp:275: error: expected â,â or â;â before â{â token
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
make: Leaving directory /home/xxx/testdb2/node_modules/ibm_db/build' gyp ERR! build error gyp ERR! stack Error:makefailed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/xxx/JoyentSVT64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:107:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1045:12) gyp ERR! System Linux 2.6.32-431.1.2.el6.x86_64 gyp ERR! command "node" "/home/xxx/JoyentSVT64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" gyp ERR! cwd /home/xxx/testdb2/node_modules/ibm_db gyp ERR! node -v v0.11.12 gyp ERR! node-gyp -v v0.12.2 gyp ERR! not ok npm ERR! [email protected] preinstall:node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls ibm_db
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-431.1.2.el6.x86_64
npm ERR! command "/home/xxx/JoyentSVT64/bin/node" "/home/ixxx/JoyentSVT64/bin/npm" "install" "ibm_db"
npm ERR! cwd /home/xxx/testdb2
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/xxx/testdb2/npm-debug.log
npm ERR! not ok code 0

in the npm-debug.log

Can't install on Windows 7

Following the instructions at https://www.npmjs.org/package/ibm_db, I have the IBM DB2 v9.7 Data Server Driver installed at C:\Program Files\ibm\IBM DATA SERVER DRIVER and I have set the environment variable:

set IBM_DB_HOME=C:\Program Files\ibm\IBM DATA SERVER DRIVER

However the result when I run npm install ibm_db is:

C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun>npm install ibm_db
npm WARN package.json [email protected] No repository field.
/


> [email protected] preinstall C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db
> node-gyp configure build


C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  odbc.cpp
  odbc_connection.cpp
  odbc_statement.cpp
  odbc_result.cpp
  dynodbc.cpp
c:\users\admin\documents\2014-07-21 - cloud integration\pvanrun\node_modules\ibm_db\src\odbc.h(29): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (..\src\odbc_connection.cpp) [C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db\build\odbc_bindings.vcxproj]
c:\users\admin\documents\2014-07-21 - cloud integration\pvanrun\node_modules\ibm_db\src\odbc.h(29): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (..\src\odbc_statement.cpp) [C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db\build\odbc_bindings.vcxproj]
c:\users\admin\documents\2014-07-21 - cloud integration\pvanrun\node_modules\ibm_db\src\odbc.h(29): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (..\src\odbc_result.cpp) [C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db\build\odbc_bindings.vcxproj]
c:\users\admin\documents\2014-07-21 - cloud integration\pvanrun\node_modules\ibm_db\src\odbc.h(29): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (..\src\odbc.cpp) [C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db\build\odbc_bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\node_modules\ibm_db
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! [email protected] preinstall: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls ibm_db
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ibm_db"
npm ERR! cwd C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\admin\Documents\2014-07-21 - Cloud Integration\pvanrun\npm-debug.log
npm ERR! not ok code 0

Things I have tried which failed to solve this problem: running the command from a DB2 command line; running from a Visual Studio command line; moving the drivers to a path with no spaces (C:\IBM_DATA_SERVER_DRIVER), adding the include directory to my INCLUDE environment variable.

problem with bigint values

When returning Bigint values, there is a native problem of JavaScript. Maybe, it could be possible to wrap these Bigint values as special objects like another packages, such as Mongoose does, using a custom Long class.

I'm saving a 10205152031467301 value, it's saved without problems maybe because at first it's in string format. When I do a SELECT query, using node-ibm_db, it returns 10205152031467300 the same result that parseInt(10205152031467301).

Thanks.

Connectivity issues with ibm_db node module version 0.0.11

We are facing connection related issues(it was working fine in 0.0.9 version) with ibm_db nodemodule version 0.0.11

Scenario:

  1. Create a pool.
  2. Get the connection from pool - This will create a new connection as there is no connection available in pool
  3. Execute the query.
  4. Release the connection. This will put back the connection in to pool for further get connection requests.
  5. Invalidate the connection by removing the network connectivity -- this happened due to db down
  6. Get the connection - This will get the connection from pool.
  7. Execute the query.
    Error Messgae:Error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "hostname". Communication function detecting the error: "send". Protocol specific error code(s): "10054", "*", "0". SQLSTATE=08001
  8. My DB was after above failure.
  9. All next requests are returning the empty results.(If DB down also, giving the same error)

Sample program details:
Program will execute same SQL query thrice in the interval of 30 secs. After first execution, please make your db down. It will throw above mentioned error for second execution.. For third execution, its returning the empty response([ ]).

This will be common scenario. Every one will hit this issue.

Attempt to connect failed. Errors according port.

Hi, I'm having problems to connect to an iSeries DB2.
When I choose 8471 port to connect I have a timeout error and can't connect.
{ [Error: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.100.0.25". Communication function detecting the error: "selectForRecvTimeout". Protocol specific error code(s): "115", "", "". SQLSTATE=08001]
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "10.100.0.25". Communication function detecting the error: "selectForRecvTimeout". Protocol specific error code(s): "115", "
", "". SQLSTATE=08001\n', state: '08001' }

When I choose 446 port I have and licensing error:
{ [Error: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968]
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968\n', state: '42968' }

Wich one it's the correct port (if there is one) and how to solved (if it's possible, 'cause as far as I know, licensing error I need a license, that I do not have) ?

Thx for your help.

problem with date timezone values

Hi,

Well, I don't know if it's a problem of db2 or ibm_db or JavaScript, could you help me please?:

My DB2 database has the following timezone -60,000, that is GMT -0600, so, for example, I have a 2014-11-07 18:20:44.81477 value as a TIMESTAMP on DB2, (as I read, a timestamp doesn't include the timezone).

My application's OS timezone is GMT -5, and it's returing that timestamp value as following :

Fri Nov 07 2014 18:20:44 GMT-0500 (SA Pacific Standard Time) , I think that this is product of
new Date('2014-11-07 18:20:44.81477') that returns the worst result. The expected result is Fri Nov 07 2014 18:20:44 GMT-0600 (SA Pacific Standard Time).

By now, my workaround is to use momentjs, where global.db2_tz is the DB2 timezone :

moment(timestamp_value).subtract(global.db2_tz - -(moment().zone()/60),'hours').zone(0)

[Sorry, I didn't try the intermediate_fixes branch, let me try it and if the problem is resolved I will close the issue]

Thanks

Stored procedure support

I suppose there's no stored procedure support since it's not documented

Anyway, I've tried to run some tests and I was not able to get any result.

Is there any plan to add stored procedure support?

0.0.13 build error on bluemix

I build a bluemix web app using Internet of Things Foundation Starter boilerplate and the following build error occurs.

-----> Downloaded app package (108K)

-----> IBM SDK for Node.js Buildpack v2.3-20150720-1448
       Based on Cloud Foundry Node.js Buildpack v64
-----> Reading application state
       package.json...
       build directory...
       cache directory...
       environment variables...
       Node engine range:   0.10.x
       Npm engine:          unspecified
       Start mechanism:     none
       node_modules source: package.json
       node_modules cached: false
       NPM_CONFIG_PRODUCTION=true
       NODE_MODULES_CACHE=true
-----> Installing binaries
       Resolving node version 0.10.x via 'node-version-resolver'
       Installing IBM SDK for Node.js (0.10.40) from cache
       Using default npm version: 1.4.28
-----> Checking and configuring service extensions before installing dependencies
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
jq: error: Cannot iterate over null
-----> Building dependencies
       Installing node modules
       npm WARN package.json [email protected] No repository field.
       > [email protected] preinstall /tmp/staged/app/node_modules/getmac/node_modules/extract-opts/node_modules/typechecker
       > node ./cyclic.js
       > [email protected] install /tmp/staged/app/node_modules/mongodb/node_modules/kerberos
       > (node-gyp rebuild 2> builderror.log) || (exit 0)
       make: Entering directory `/tmp/staged/app/node_modules/mongodb/node_modules/kerberos/build'
         CXX(target) Release/obj.target/kerberos/lib/kerberos.o
         CXX(target) Release/obj.target/kerberos/lib/worker.o
         CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
         CC(target) Release/obj.target/kerberos/lib/base64.o
         CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
         SOLINK_MODULE(target) Release/obj.target/kerberos.node
         SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
         COPY Release/kerberos.node
       make: Leaving directory `/tmp/staged/app/node_modules/mongodb/node_modules/kerberos/build'
       > [email protected] install /tmp/staged/app/node_modules/mongodb/node_modules/bson
       > (node-gyp rebuild 2> builderror.log) || (exit 0)
       make: Entering directory `/tmp/staged/app/node_modules/mongodb/node_modules/bson/build'
         CXX(target) Release/obj.target/bson/ext/bson.o
         SOLINK_MODULE(target) Release/obj.target/bson.node
         SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
         COPY Release/bson.node
       make: Leaving directory `/tmp/staged/app/node_modules/mongodb/node_modules/bson/build'
       > [email protected] install /tmp/staged/app/node_modules/node-red-nodes-cf-sqldb-dashdb/node_modules/ibm_db
       > node installer/driverInstall.js
       Downloading DB2 ODBC CLI Driver from http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz...
       Download and extraction of DB2 ODBC CLI Driver completed successfully ...
       make: Entering directory `/tmp/staged/app/node_modules/node-red-nodes-cf-sqldb-dashdb/node_modules/ibm_db/build'
         CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
         CXX(target) Release/obj.target/odbc_bindings/src/odbc_connection.o
         CXX(target) Release/obj.target/odbc_bindings/src/odbc_statement.o
         CXX(target) Release/obj.target/odbc_bindings/src/odbc_result.o
         CXX(target) Release/obj.target/odbc_bindings/src/dynodbc.o
         SOLINK_MODULE(target) Release/obj.target/odbc_bindings.node
       make: Leaving directory `/tmp/staged/app/node_modules/node-red-nodes-cf-sqldb-dashdb/node_modules/ibm_db/build'
       { [Error: Command failed: /usr/bin/ld: cannot find -ldb2
       collect2: ld returned 1 exit status
       make: *** [Release/obj.target/odbc_bindings.node] Error 1
       gyp ERR! build error 
       gyp ERR! stack Error: `make` failed with exit code: 2
       gyp ERR! stack     at ChildProcess.onExit (/tmp/staged/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:268:23)
       gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
       gyp ERR! System Linux 3.13.0-39-generic
       gyp ERR! command "node" "/tmp/staged/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/tmp/staged/app/node_modules/node-red-nodes-cf-sqldb-dashdb/node_modules/ibm_db/installer/clidriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=true"
       gyp ERR! cwd /tmp/staged/app/node_modules/node-red-nodes-cf-sqldb-dashdb/node_modules/ibm_db
       gyp ERR! node -v v0.10.40
       gyp ERR! node-gyp -v v1.0.1
       gyp ERR! not ok 
       ] killed: false, code: 1, signal: null }
       > [email protected] install /tmp/staged/app/node_modules/node-red/node_modules/bcrypt
       > node-gyp rebuild
       make: Entering directory `/tmp/staged/app/node_modules/node-red/node_modules/bcrypt/build'
         CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
         CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
         CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
         SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
         SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node: Finished
         COPY Release/bcrypt_lib.node
       make: Leaving directory `/tmp/staged/app/node_modules/node-red/node_modules/bcrypt/build'
       > [email protected] install /tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/bufferutil
       > node-gyp rebuild
       make: Entering directory `/tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/bufferutil/build'
         CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
         SOLINK_MODULE(target) Release/obj.target/bufferutil.node
         SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
         COPY Release/bufferutil.node
       make: Leaving directory `/tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/bufferutil/build'
       > [email protected] install /tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/utf-8-validate
       > node-gyp rebuild
       make: Entering directory `/tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/utf-8-validate/build'
         CXX(target) Release/obj.target/validation/src/validation.o
         SOLINK_MODULE(target) Release/obj.target/validation.node
         SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
         COPY Release/validation.node
       make: Leaving directory `/tmp/staged/app/node_modules/node-red/node_modules/ws/node_modules/utf-8-validate/build'
       > [email protected] install /tmp/staged/app/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport
       > node-pre-gyp install --fallback-to-build
       [serialport] Success: "/tmp/staged/app/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/build/serialport/v1.7.4/Release/node-v11-linux-x64/serialport.node" is installed via remote
       npm ERR! [email protected] install: `node installer/driverInstall.js`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the [email protected] install script.
       npm ERR! This is most likely a problem with the ibm_db package,
       npm ERR! not with npm itself.
       npm ERR! Tell the author that this fails on your system:
       npm ERR!     node installer/driverInstall.js
       npm ERR! You can get their info via:
       npm ERR!     npm owner ls ibm_db
       npm ERR! There is likely additional logging output above.
       npm ERR! System Linux 3.13.0-39-generic
       npm ERR! command "/tmp/staged/app/vendor/node/bin/node" "/tmp/staged/app/vendor/node/bin/npm" "install" "--unsafe-perm" "--quiet" "--userconfig" "/tmp/staged/app/.npmrc"
       npm ERR! cwd /tmp/staged/app
       npm ERR! node -v v0.10.40
       npm ERR! npm -v 1.4.28
       npm ERR! code ELIFECYCLE

FAILED
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase

Can't get correct result when call store procedure in IBMDB2

In IBMDB2, I can't call procedure with type parameter is output. I always get result is null array


---- Store Procedure SP_PROC1
CREATE PROCEDURE sp_proc1 (IN VARNAME VARCHAR(128), OUT VARCOUNT INTEGER)
P1: BEGIN
-- #######################################################################
-- # Returns count of tables created by ROOT and like VARNAME
-- #######################################################################
SELECT COUNT(*) INTO VARCOUNT FROM SYSIBM.SYSTABLES
WHERE CREATOR = 'ROOT' AND NAME LIKE CAST('%'||VARNAME||'%' as VARCHAR(128));
END P1

In the db2 studio I created store procedure and run test with input parameter VARNAME = "CA" and it return value with output parameter VARCOUNT = 3

code in nodejs


conn.query("call ROOT.SP_PROC1(?,?)", ['CA',0] , function (err, rows, more) {
      console.log( err, rows, more );
      db.close(function () {
        console.log("Connection Closed");
      });
})

console log


null [] false

so, how to handle bound parameters for output as I am intending to use here.

bindings.js:79 - Error: The specified procedure could not be found.

The documention seems to imply that using this ibm_db module is as simple as running:

npm install ibm_db

and then running the basic samples provided.

I have a db2 server on the LAN, and I've tried to get the ibm_db module to work on two operating systems so far: Ubuntu 14.01 64bit and Windows 7 64 bit, and neither have I succeed with.

On both OSs I get this:
node_modules\ibm_db\node_modules\bindings\bindings.js:79
throw e
^
Error: The specified procedure could not be found.

Even with Google I'm having difficulty getting to the bottom of this. Please advise.

Errors when building ibm_db

Hello, I'm receiving errors when trying to build ibm_db.

System: I'm using the latest release of 64 bit linux mint.

Steps:
1.) I installed node and npm.
2.) I created my project directory + the node modules folder
3.) I downloaded and installed installed Data Server Client v9.7. I've verified that all the files installed in the correct default folder under /opt/ibm/db2.
4.) I've cloned ibm_db into my project's node_modules folder and issues "node-gyp configure"
5.) On "node-gyp build" I get the following output...

sudo node-gyp build > debug.txt
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
/usr/bin/ld: cannot find -ldb2o
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/odbc_bindings.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/bin/node-gyp" "build"
gyp ERR! cwd /home/mint/Programming/CCP/node_modules/node-ibm_db
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok

What steps do I need to take to ensure that this builds correctly, or is this an actual issue?

IBM_DB Test Cases Failed on linux 32 bit

Node Build: v0.12.7-IBMBuild-1.2.0.6-201508160201 (32bit)

The 64 bit versions of node on linux worked fine, but on the same systems the 32 bit versions have the following tests fail on these machines:

Machine Information:
RHEL 7
SUSE Linux 11
SLES 12

Running test for [DB2] : test-binding-statement-executeSync ... fail
Running test for [DB2] : test-binding-transaction-commit ... fail
Running test for [DB2] : test-binding-transaction-commitSync ... fail
Running test for [DB2] : test-describe-column ... fail
Running test for [DB2] : test-describe-database ... fail
Running test for [DB2] : test-describe-table ... fail
Running test for [DB2] : test-prepareSync-bad-sql ... fail
Running test for [DB2] : test-prepareSync-multiple-execution ... fail
Running test for [DB2] : test-transaction-commit-sync ... fail
Running test for [DB2] : test-transaction-commit ... fail

All these tests pass on the 64 bit node build on the same machines with the exact same database and the same ibm_db/test/config.testConnectionStrings.json configurations.

Here is a breakdown of each tests issues:

  1. test-binding-statement-executeSync
    Error is caught and logged at line 65 and logs:

{ [Error: [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009]
errors: [],
error: '[node-odbc] Error in ODBCStatement::BindSync',
message: '[IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009',
state: 'HY009' }

  1. test-binding-transaction-commit
    data = result.fetchAllSync();
    ^
    Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002
    at Error (native)
    at /home/nodebot/nodetest-V12_32/node_modules/ibm_db/test/test-binding-transaction-commit.js:34:25

  2. test-binding-transaction-commitSync
    Failed when rolling back
    { [Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002]
    errors: [],
    error: '[node-odbc] Error in ODBC::GetColumnValue',
    message: '[IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002',
    state: '22002' }
    Failed when committing
    { [Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002]
    errors: [],
    error: '[node-odbc] Error in ODBC::GetColumnValue',
    message: '[IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002',
    state: '22002' }

  3. test-describe-column
    connected
    [IBM][CLI Driver][DB2/NT] SQL0204N "ELKOREHP.NODE_ODBC_TEST_TABLE" is an undefined name. SQLSTATE=42704

tables dropped
tables created

undefined:0

Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002
at Error (native)

  1. test-describe-database
    undefined:0

Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002
at Error (native)

  1. test-describe-table
    undefined:0

Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002
at Error (native)

  1. test-prepareSync-bad-sql
    stmt.bindSync(["hello world", 1, null]);
    ^
    Error: [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009
    at Error (native)
    at Object. (/home/nodebot/nodetest-V12_32/node_modules/ibm_db/test/test-prepareSync-bad-sql.js:13:6)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

  2. test-prepareSync-multilple-execution
    [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009
    finish exit value: 3

  3. test-transaction-commit-sync
    Failed when committing
    { [Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002]
    errors: [],
    error: '[node-odbc] Error in ODBC::GetColumnValue',
    message: '[IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002',
    state: '22002' }

  4. test-transaction-commit
    var data = result.fetchAllSync();
    ^
    Error: [IBM][CLI Driver] CLI0110E Invalid output or indicator buffer specified. SQLSTATE=22002
    at Error (native)
    at Database.querySync (/home/nodebot/nodetest-V12_32/node_modules/ibm_db/lib/odbc.js:419:21)
    at /home/nodebot/nodetest-V12_32/node_modules/ibm_db/test/test-transaction-commit.js:60:19

Build error on 0.0.13

Ran into this error this morning on local attempt to npm install ibm_db:

In file included from ../src/odbc.cpp:25:
../src/odbc.h:30:10: fatal error: 'sqlcli1.h' file not found
#include <sqlcli1.h>
         ^
1 error generated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.3.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/Users/joshuarichard/node_modules/ibm_db/installer/clidriver" "--IBM_DB_HOME_WIN=%IBM_DB_HOME%" "--IS_DOWNLOADED=true"
gyp ERR! cwd /Users/joshuarichard/node_modules/ibm_db
gyp ERR! node -v v0.12.5
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c node-gyp configure build --IBM_DB_HOME=$IBM_DB_HOME --IBM_DB_HOME_WIN=%IBM_DB_HOME% --IS_DOWNLOADED=true' }
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "ibm_db"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node installer/driverInstall.js'.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node installer/driverInstall.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls ibm_db
npm ERR! There is likely additional logging output above.

The database alias name or database name "" could not be found. SQLSTATE=42705 error

Hi,

I'm trying to connect to Informix database and I'm getting following error:

{ [Error: [IBM][CLI Driver] SQL1013N  The database alias name or database name "" could not be found.  SQLSTATE=42705
]
  error: '[node-odbc] SQL_ERROR',
  message: '[IBM][CLI Driver] SQL1013N  The database alias name or database name "" could not be found.  SQLSTATE=42705\
r\n',
  state: '08001' }

My configuration is as follows:

ibmdb.open("DRIVER={Informix};DATABASE=my_db_name;SERVER=my_db_server;HOST=127.0.0.1;UID=my_user;PWD=my_user_pwd;PORT=8000;PROTOCOL=onsoctcp;", function (err,conn) {
if (err) return console.log(err);
// query goes here...
});

Note the above meant to map to the following connection string: jdbc:informix-sqli://127.0.0.1:8000/my_db-name:INFORMIXSERVER= my_db_server.

I can connect to the same instance of Informix using a GUI DBVisualizer tool using same credentials so it's not the problem with the instance itself.

Any idea why the connection string in ibmdb.open does not correctly recognize my database name?

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.