Giter Club home page Giter Club logo

node-odbc's People

Contributors

bbigras avatar blakmatrix avatar gurzgri avatar sannis 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-odbc's Issues

npm install odbc problems on CentOS 64bit

Trying to follow the wiki connection walk through examples and get the following errors in response to 'npm install odbc' (Note I have already checked that the yum installs for unixODBC and unixODBC-devel say they are up to date and freetds seems to be working correctly also).

$ npm install odbc
npm http GET https://registry.npmjs.org/odbc
npm http 304 https://registry.npmjs.org/odbc

[email protected] preinstall /var/www/html/rovctd/node2solstice/node_modules/odbc
node-gyp configure build

make: Entering directory /var/www/html/rovctd/node2solstice/node_modules/odbc/build' CXX(target) Release/obj.target/odbc_bindings/src/odbc.o ../src/odbc.cpp: In static member function 'static v8::Handle<v8::Value> ODBC::GetColumnValue(void*, Column, uint16_t*, int)': ../src/odbc.cpp:450: error: expected primary-expression before '.' token ../src/odbc.cpp:451: error: expected primary-expression before '.' token ../src/odbc.cpp:452: error: expected primary-expression before '.' token ../src/odbc.cpp:453: error: expected primary-expression before '.' token ../src/odbc.cpp:454: error: expected primary-expression before '.' token ../src/odbc.cpp:455: error: expected primary-expression before '.' token ../src/odbc.cpp:456: error: expected primary-expression before '.' token ../src/odbc.cpp:457: error: expected primary-expression before '.' token ../src/odbc.cpp:458: error: expected primary-expression before '.' token ../src/odbc.cpp:459: error: expected primary-expression before '.' token ../src/odbc.cpp:460: error: expected primary-expression before '.' token make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1 make: Leaving directory/var/www/html/rovctd/node2solstice/node_modules/odbc/build'
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:797:12)
gyp ERR! System Linux 2.6.32-431.11.2.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /var/www/html/rovctd/node2solstice/node_modules/odbc
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
$

ConnectTimeout to be made configurable

Hi Daniel

I see that the connectTimeOut interval is been set to 5 seconds, with a TODO for making it configurable.

We were trying to connect to DB2 server behind tight firewalls and started hitting a connect time out failure. Could you comment out setting the timeout until it is made configurable?

Thanks

Praveen

odbc_bindings.node: undefined symbol: SQLGetDiagField

Still trying to get prepare or prepareSync to return an error on bad sql but can't get around the above msg...

Your test also fails:

$ node test-prepare.js
node: symbol lookup error:
......../node_modules/odbc/build/Release/odbc_bindings.node: undefined symbol: SQLGetDiagField

It might be related to this:
wankdanker@4d5e700

thanks!!

Odbc not compliant with nodeJs 0.10

When running my application using latest node-odbc and with node runtime 0.10.3, I have the following error :

module.js:356
Module._extensions[extension](this, filename);
^
Error: Module version mismatch. Expected 11, got 1.
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/jcamus/myModule/node_modules/odbc/odbc.js:25:12)
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)

Unicode in SQL String does not work for MSSQL

With v0.5.17, Unicode SQL strings work with sqlite3 and mysql. But they do not work with MSSQL via FreeTDS or on Windows with the native client. Unicode bound parameters do work with MSSQL though, at least on Windows.

print statement in stored-procedure (t-sql/mssql) returns empty result

Hi Dan,

First of all thanks for your great work on node-odbc!
But there seems to be an issue.

If I execute a stored-procedure with db.sqlquery() it returns an empty result foreach print statement or "X rows affected" message.

For me excepted behavior would be to ignore "X rows affected message" and print statements.

Workaround cleary is to set "NOCOUNT ON", but it would be nice if this gets fixed.

node-odbc v0.6.3
MSSQL 2008R2
node v0.10.24
windows 8.1 64-Bit

The callback for db.close() never gets invoked

Sorry, this may be more of a question than an issue but I don't know where else to ask it.

If I call open() on the db object, then close(), the callback for close() will get invoked. If, however, I add in a call to db.describe(), the callback for close() never gets invoked. Is there some kind of cleanup I need to do?

https://gist.github.com/theduderog/d24bf6820d9a034f1763

I'm using Ubuntu 12.04, node v0.10.11, libsqliteodbc 0.91-3, unixodbc 2.2.14p2-5ubuntu3 but I've also tested that the same behavior happens with the SAP Hana odbc driver.

node-odbc doesn't build since node::EventEmitter was removed

While trying to build node-odbc I got :

../src/Database.cpp:20:25: error: node_events.h: No such file or directory

I think it's since node::EventEmitter was removed from node.js which could be about two releases ago but I only got it today when I upgraded to 0.6.0 (stable).

$ ./build.sh
Setting srcdir to                        : /home/bbigras/project/node_modules/node-odbc
Setting blddir to                        : /home/bbigras/project/node_modules/node-odbc/build
Checking for program g++ or c++          : /usr/bin/g++
Checking for program cpp                 : /usr/bin/cpp
Checking for program ar                  : /usr/bin/ar
Checking for program ranlib              : /usr/bin/ranlib
Checking for g++                         : ok
Checking for node path                   : not found
Checking for node prefix                 : ok /usr
Checking for library odbc                : yes
'configure' finished successfully (1.002s)
Waf: Entering directory `/home/bbigras/project/node_modules/node-odbc/build'
[1/2] cxx: src/Database.cpp -> build/Release/src/Database_1.o
../src/Database.cpp:20:25: error: node_events.h: No such file or directory
In file included from ../src/Database.cpp:23:
../src/Database.h:34: error: expected class-name before ‘{’ token
../src/Database.h: In constructor ‘Database::Database()’:
../src/Database.h:41: error: class ‘Database’ does not have any field named ‘EventEmitter’
../src/Database.cpp: In static member function ‘static void Database::Init(v8::Handle<v8::Object>)’:
../src/Database.cpp:45: error: ‘EventEmitter’ has not been declared
../src/Database.cpp: In static member function ‘static v8::Handle<v8::Value> Database::New(const v8::Arguments&)’:
../src/Database.cpp:62: error: ‘class Database’ has no member named ‘Wrap’
../src/Database.cpp: In static member function ‘static int Database::EIO_AfterOpen(eio_req*)’:
../src/Database.cpp:80: error: ‘class Database’ has no member named ‘Unref’
../src/Database.cpp:87: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp: In static member function ‘static v8::Handle<v8::Value> Database::Open(const v8::Arguments&)’:
../src/Database.cpp:148: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
../src/Database.cpp:148: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
../src/Database.cpp:151: error: ‘class Database’ has no member named ‘Ref’
../src/Database.cpp: In static member function ‘static int Database::EIO_AfterClose(eio_req*)’:
../src/Database.cpp:172: error: ‘class Database’ has no member named ‘Unref’
../src/Database.cpp:179: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp: In static member function ‘static v8::Handle<v8::Value> Database::Close(const v8::Arguments&)’:
../src/Database.cpp:216: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
../src/Database.cpp:216: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
../src/Database.cpp:219: error: ‘class Database’ has no member named ‘Ref’
../src/Database.cpp: In static member function ‘static int Database::EIO_AfterQuery(eio_req*)’:
../src/Database.cpp:257: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp:260: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp:288: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp:353: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp:461: error: ‘class Database’ has no member named ‘Emit’
../src/Database.cpp:469: error: ‘class Database’ has no member named ‘Unref’
../src/Database.cpp: In static member function ‘static v8::Handle<v8::Value> Database::Query(const v8::Arguments&)’:
../src/Database.cpp:530: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
../src/Database.cpp:530: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
../src/Database.cpp:533: error: ‘class Database’ has no member named ‘Ref’
../src/Database.cpp: In static member function ‘static v8::Handle<v8::Value> Database::Tables(const v8::Arguments&)’:
../src/Database.cpp:608: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
../src/Database.cpp:608: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
../src/Database.cpp:611: error: ‘class Database’ has no member named ‘Ref’
../src/Database.cpp: In static member function ‘static v8::Handle<v8::Value> Database::Columns(const v8::Arguments&)’:
../src/Database.cpp:687: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’
../src/Database.cpp:687: error:   initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’
../src/Database.cpp:690: error: ‘class Database’ has no member named ‘Ref’
Waf: Leaving directory `/home/bbigras/project/node_modules/node-odbc/build'
Build failed:  -> task failed (err #1):
        {task: cxx Database.cpp -> Database_1.o}

Option to run only with driver library (without driver manager)

Hi
I have made modifications to node-odbc to communicate direct with sql driver without the need to define data sources etc. In this configuration requirement is only a one shared library of odbc driver (ie. in the current directory). This allows to deploy program without modification of global system configuration (It is even not required to have odbc installed in th system). What do you think about this possibility ?
I have tested this under Windows but it should run under Linux. I'm new to github so please tell me how can I send my modifications ?
Paul

Naming the returned fields

I noticed that when I test my application on my local machine, the returned fields look like this:

CREATED_DATE: ...

but when I move this app into server, the fields fetched look like this:

CreatedDate: ...

Database used is DB2. The ODBC-driver's version is different on the server than on my local machine, so I guess that is the reason for the above behavior.

However, the problem is that I am fetching field that has totally different name than CREATED_DATE. The field is named as SBCHA.

Why is the returned field translated (SBCHA -> CREATED_DATE)? How can I toggle this feature off?

stop using eio_custom

Calling eio_custom directly is not cross platform and calling it directly is broken in node 0.7.x. The proper thing to do is to call uv_queue_work instead.

Apparently uv_queue_work will call eio_custom on Unix and whatever the proper equivalent is on Windows.

OLTP type fast path without prepare

Any chance of getting functions that avoid the SQLPrepare call each time?

They would consist of:
1 - call for SQLPrepare - to prepare hStmt up front
2 - call for SQLBindParameter/SQLExecute using the hStmt from the prepare

Would be used by high volume guys to reduce cpu. Like with billions of inserts a day for example...

Truncated error message

Using 0.5.25 from git, mac osx, node 0.10.17, an error occurs on db.open, but both the state and message are truncated:

{ error: '[node-odbc] SQL_ERROR', message: '[', state: 'I' }

Any ideas?

v0.4.4 requests libodbc.so.1

Having updated from node 0.8 + odbc 0.4.3 to node 0.10 and odbc 0.4.4 seems to have broken something. The module tries to fetch libodbc.so.1 which the previous version didn't try.

Encoding problem (MSSQL)

I tried using node-odbc to connect to our Microsoft SQL Server 2005,
After running a query i get this warning for each row:

EIO_Query => [FreeTDS][SQL Server]Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks ('?')

I wouldn't bother about the warnings but also all the local characters are replaced for � in result data.

My FreeTDS is configured properly with client charset set as UTF-8.
I've got no issues connecting to our mssql server with freetds under my ruby and python apps.

Am I doing something wrong or is it a bug ?

Matej Drzik

[IBM-DB2] Returns error object with no properties from a simple query.

Executing a simple .query('select * from table' [...]) returns an error object with no property, not even code or description.

Although, It does send me a complete error object when there's a bad configuration on .open or most of driver exceptions occur.

I'm working on a spare time project and got no time and tools now to debug the core. Sorry.

Issue registered, incomplete but waiting for more information.
Thank you for the good work.

Callbacks from node-odbc lose context

This issue has been tested using node.js 0.10.13 and node-odbc 0.5.23.

This is an issue I encountered when trying to throw exceptions from within node-odbc's callbacks. As it seems, whenever node-odbc executes the callback function, the context is lost, making it impossible to elegantly handle exceptions with domains.

Consider following code:

require("longjohn");

var domain = require("domain");

var d = domain.create();

d.on("error", function (error) {
    console.log("Error caught!");
});

d.run(function() {
    var db = require("odbc")();

    console.trace();

    db.open("wrongConnectionString", function (error) {
        console.trace();

        throw new Error();
    });
});

An expected output would contain two stack traces, with the second one containing the first, and "Error caught!" printed out. However, the actual output is:

Trace
    at /home/vagrant/test-app/index.js:14:13
    at b (domain.js:183:18)
    at Domain.run (domain.js:123:23)
    at Object.<anonymous> (/home/vagrant/test-app/index.js:11:3)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Module._load (module.js:312:12)
    at Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
Trace
    at /home/vagrant/test-app/index.js:17:17
    at /home/vagrant/test-app/node_modules/odbc/lib/odbc.js:88:23

/home/vagrant/test-app/index.js:19
        throw new Error();
              ^
Error
    at /home/vagrant/test-app/index.js:19:15
    at /home/vagrant/test-app/node_modules/odbc/lib/odbc.js:88:23

As can be seen on the second stack trace - everything before callback execution is lost and domain cannot handle the exception. The only way to catch it is to listen to unhandledException event.

This can be compared with such code:

require("longjohn");

var domain = require("domain");

var d = domain.create();

d.on("error", function (error) {
    console.log("Error caught!");
});

d.run(function() {
    console.trace();

    process.nextTick(function () {
        console.trace();

        throw new Error();
    });
});

The code above outputs, as expected:

Trace
    at /home/vagrant/test-app/index.js:12:13
    at b (domain.js:183:18)
    at Domain.run (domain.js:123:23)
    at Object.<anonymous> (/home/vagrant/test-app/index.js:11:3)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Module._load (module.js:312:12)
    at Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
Trace
    at /home/vagrant/test-app/index.js:15:17
    at process._tickDomainCallback (node.js:459:13)
    at Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:901:3
---------------------------------------------
    at /home/vagrant/test-app/index.js:14:13
    at b (domain.js:183:18)
    at Domain.run (domain.js:123:23)
    at Object.<anonymous> (/home/vagrant/test-app/index.js:11:3)
    at Module._compile (module.js:456:26)
    at Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Module._load (module.js:312:12)
Error caught!

latest 5.14 level more asynchronous? (probably not an issue but wanted to update you)

I would have emailed this but I don't have any address for you.

Thanks for all the work on issue #32 by the way!!! it's working great....

Interesting thing... I was running through last Friday afternoon with your 5.10 level (with your May 3 changes) and no issues. Then I upgraded to your 5.14 Friday evening, tested and again no issues.

Then under a heavier than normal load on Monday and today, an area of my code I thought was ok (stringing together partial http responses until I get a complete well formed xml packet) started throwing errors saying malformed xml. Sure enough, it was obvious I was overlaying the string. Not many, out of 3mill maybe about 3k so 0.1% but still...

No problem and I bet it's my bad related to piecing together http... and I've read I should be using mikeal's request module instead of core http client anyway... so I've started converting and hope this issue will go away.

But my question (finally got here) was what might have changed between May 3 and May 10 in your code that could have made the database calls work differently under heavy load?

had switched to node 10.5 back on May 3 and nothing else changed over the weekend...

Thanks again!!

Error handling when issuing a query

In EIO_Query we check to see if SQLExecDirect succeeded or failed. If it failed, should we:

Emit('result', ... ) immediately and somehow cancel the EIO_AfterQuery?

or

Save the error to prep_req and Emit('result', ... ) from EIO_AfterQuery including the error, a null recordset and false moreRecordSets?

Also, should there be an Emit('error') somewhere so that we can have a handler on the javascript side to receive callbacks for errors? I don't think I would use this, but still wondering.

Dan

Calling stored procedure which returns no results sets more results set to true

I'm seeing a problem in my nodejs application:

If a stored procedure returns an empty table, then more results is set to true (even when I don't expect it to be).

Here is a simple repro (using SQL Server 2008):

SQL Server:

create table mytable 
(
  ID int IDENTITY(1,1) PRIMARY KEY,
  count int
)

create procedure dbo.qry_mytable
@id INT
AS 
SET NOCOUNT ON
select * from mytable where ID = @id

insert into mytable (count) values (1)

Node application:

var express = require('express');
var odbc = require('odbc')();
var app = express();
var cn = "DSN=mydsn;UID=myuid;PWD=mypwd;DATABASE=mydb";

app.get('/:id', function(req, res, next) {
  var id = req.param('id');
  odbc.open(cn, function (err) {
    if (err) return console.log(err);

    var sql = 'exec dbo.qry_mytable @id=?';
    var params = [id]; 

    odbc.query(sql, params, function (err, data, more) {
      if (err) console.log(err);

      console.log('more', more);
      res.json(more);

      if (!more) {
        odbc.close(function () {
          console.log('done');
        });
      }
    });
  });  
});

var server = app.listen(3000, function() {
  console.log('Listening on port %d', server.address().port);
});

Navigating to http://:3000/1 returns false, whereas navigating to http://:3000/2 returns true!

Any ideas if this is a problem with my SQL/node application or if this is a bug in odbc?

Thanks

node-odbc can't see library file

We are getting the error:

{ error: '[node-odbc] SQL_ERROR',
message: '[unixODBC][Driver Manager]Can't open lib '/usr/lib/libhiveodbc.so.1' : file not found',
state: '01000'

The file is there and we can use it using isql so we can;t work out what the issue is. ITs a 32bit version.

Any ideas?

node.js, odbc, monetdb - varchar attributes all null

Friends of Code. I have a basic sample of odbc db lines running in node.js. Unfortunately for all db queries i make varchar attributes are reported as "null".

var db = require('odbc')()
, cn = process.env.ODBC_CONNECTION_STRING
;

db.open(cn, function (err) {
if (err) return console.log(err);

db.query('select * from users', function (err, data) {
if (err) console.log(err);

console.log(data);

db.close(function () {
console.log('done');
});
});
});

Running this results as:

[ { name: null, fullname: null, default_schema: 2000 },
{ name: null, fullname: null, default_schema: 5899 } ]
done

While in monetdb it looks as follows:

+---------+---------------+----------------+
| name | fullname | default_schema |
+=========+===============+================+
| monetdb | MonetDB Admin | 2000 |
| wyh | wyh analytics | 5899 |
+---------+---------------+----------------+

Any ideas??

cannot install on ubuntu

i installed node version 0.8.24 and im having problems installing the package

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/vinicius/node-odbc/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/vinicius/.node-gyp/0.8.24/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/vinicius/.node-gyp/0.8.24',
gyp info spawn args '-Dmodule_root_dir=/home/vinicius/node-odbc',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory /home/vinicius/node-odbc/build' CXX(target) Release/obj.target/odbc_bindings/src/odbc.o In file included from ../src/odbc.cpp:25:0: ../src/odbc.h:28:17: fatal error: sql.h: No such file or directory compilation terminated. make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1 make: Leaving directory/home/vinicius/node-odbc/build'
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/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:680:10)
gyp ERR! System Linux 3.5.0-17-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "configure" "build"
gyp ERR! cwd /home/vinicius/node-odbc
gyp ERR! node -v v0.8.24
gyp ERR! node-gyp -v v0.10.0
gyp ERR! not ok

ODBC::GetColumnValue> (len == SQL_NULL_DATA) comparison always fails

Hi Dan,

I have an issue where I was am getting spurious values for NULL columns. (DB2, Ubuntu 12.04 64 bit).

I have enabled debug, dug around a bit and have discovered that the (len == SQL_NULL_DATA) comparisons in this proc always fail. To wit:

case SQL_INTEGER :
case SQL_SMALLINT :
case SQL_TINYINT : {
    long value;

    ret = SQLGetData(
      hStmt,
      column.index,
      SQL_C_SLONG,
      &value,
      sizeof(value),
      &len);

    DEBUG_PRINTF("ODBC::GetColumnValue: SQL_NULL_DATA=%i\n",
                SQL_NULL_DATA);

    DEBUG_PRINTF("ODBC::GetColumnValue - Integer: index=%i name=%s type=%i len=%i ret=%i\n",
                column.index, column.name, column.type, len, ret);

    if (len == SQL_NULL_DATA) {
      DEBUG_PRINTF("len == SQL_NULL_DATA?:%i\n", len);
      return scope.Close(Null());
      //return Null();
    }
    else {
      DEBUG_PRINTF("len != SQL_NULL_DATA?:%i\n", len);
      return scope.Close(Integer::New(value));
      //return Integer::New(value);
    }
  }
  break;

You will note that I've added extra debug output lines to help me figure out what's what. I get the following debug output when traversing a null integer column (and any null columns of other SQL types as well):

ODBC::GetColumnValue: SQL_NULL_DATA=-1
ODBC::GetColumnValue - Integer: index=2 name=S type=4 len=-1 ret=0
len != SQL_NULL_DATA?:-1

Clearly, -1 is not equal to -1 (!!!), so it's some sort of casting error. I am by no means an expert here so any pointers to help fix it the right way would be appreciated.

Thanks and regards,
Riaan

If list of parameters contains a null or (any non-string?) then all passed parameters will be null

This is my test case:

var common = require("./common")
        , odbc = require("../odbc.js")
        , db = new odbc.Database();


db.open(common.connectionString, function (err) {
        if (err) {
                console.error(err);
                return;
        }

        db.query("select ? as fish, ? as null_val"
                , ["fish", null]
                , function (err, data, more) {
                        if (err) {
                                console.error(err);
                                process.exit(1);
                        }

                        console.error(data);
                }
        );
});

Expected result:
[ { fish: "fish", null_val: null } ]

Actual result:
[ { fish: null, null_val: null } ]

I am trying this on OS X Lion 10.7.5 Using unixODBC + FreeTDS. Connecting to MS SQL Server.

Same thing happens if there will be a numeric value in parameters.

Connection Issue - RESOLVED

Hi,

I have been trying a couple of connections through FreeTDS to MS SQL. I have one working that has an allocated port SERVER=xx.xx.xx.xx\instance (note the double \): The issue I am having is with a standard connection on port 1433. SERVER=xx.xx.xx.xx but not sure if I should be passing the port on the db.open. The ocbc(inst).ini is configured correctly as I can get access through isql.

UPDATE ** I seem to have got it working, added PORT=1433 into the cn.

I can write a wiki if anyone likes?

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


db.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

Can you help me?
Thanks you so much.

5.18 gets glibc message

Installed your latest (5.18) on Ubuntu 32bit with:
npm install git://github.com/wankdanker/node-odbc.git#v0.5

and get:
*** glibc detected *** node: corrupted double-linked list: 0x0a0aad50 ***

when I drop back to 5.14 with this on same box:
npm install git://github.com/wankdanker/node-odbc.git#v0.5.14

there are no problems...

Memory leak

I created the following script to call a stored procedure on a remote mssql server (not under my control) using data from an http request. It's leaking memory with each request/query. Any suggestions?

var odbc = require("odbc");
var db = new odbc.Database();

db.open("DSN=fiscal;UID=<user>;PWD=<password>", function(err)
{
    if (err) {
        console.log(err.message);
        return;
    }

    require('http').createServer(function (req, res) {

        res.end();

        var parts = require('url').parse(req.url, true);
        var matches = parts.pathname.match('^/([a-zA-Z_]+)/$');

        if (matches) {

            var procedure = matches[1];
            var p = parts.query;

            var query = "declare @outcome int;"
                + " exec " + procedure + " " + p.bsID + ", " + p.ticketid + ", " + p.amount + ", @outcome OUT;"
                + " select @outcome";

            db.query(query, function(err, rows, moreResultSets)
            {
                if (err) {
                    console.log(err.message);
                } else {
                    console.log(rows);
                }
            });

        } else {
            console.log('Unable to parse request');
        }

    }).listen(8082, "127.0.0.1");
});

process.on('uncaughtException', function (err) {
    console.log('uncaughtException:' + err);
    console.log(err.stack);
});

I am using node 0.6.7 on CentOS5.

Can't insert a text string with size > 8000 bytes

When trying to insert with node.js 0.8.25 and node_odbc version 0.4.4 a string with size > 8000 bytes. It fails with the following error message :

[node-odbc] SQL_ERROR","message":"[Microsoft][SQL Server Native Client 11.0]String data, right truncation

If string is 8000 bytes length or lower it works fine.

If I insert the string directly with a database editor it works. So database and table have correct colunm types (varchar(max))

In database.cpp (line 678) code is :
params[i].type = SQL_VARCHAR

is SQL_LONGVARCHAR better to manage big strings ?

Please help !

Fetch all rows as Array of Arrays

Please, I think it's really necessary to let user fetch ALL results as Array of Arrays instead of Array of Objects,
because to convert from Array of Arrays to Array of Objects is very simple,
could be done by each user and it will work fast,
but to convert from Array of Objects to Array of Arrays will work not so quick,
and should be done by native code...

Deal with large result sets

As reported by a user and verified by my own tests, when a query returns a large result set, the node process will eat up a lot of memory and possibly result in out of memory errors. This occurs because the resulting array of objects is built up in the binding and then passed to the callback when all the records have been returned.

We should find ways to mitigate this.

Errors not being returned when preceded by other result sets

It appears that if I run a query which returns some results, followed by an error, the error (and any subsequent result sets!) are not returned to the caller. The following code illustrates the problem (I'm using MS SQL 2012 Express):

var odbc = require('odbc')
var db = new odbc.Database()
var string = "(Connection string goes here)"

var sql =
"declare @t table (x int); \
insert @t values (1); \
select 'You will get this message' \
raiserror('You will never get this error!', 16, 100); \
select 'You will never get this message, either!' as msg; \
"

db.open(string, function(err) {
    console.log(err || "Connected")

    if (!err) {
        db.query(sql, function (err, results, more) {
            console.log(err, results, more)

            if (!more) {
                console.log("Running second query")

                db.query("select 1 as x", function(err, results, more) {
                    console.log(err, results, more)

                    db.close(function(err) { console.log(err || "Closed") })
                })
            }
        })
    }
})

I get the following output:

Connected
null [] true
null [ { '': 'You will get this message' } ] false
Running second query
null [ { x: 1 } ] false
Closed

Where I would expect something like this:

Connected
null [] true
null [ { '': 'You will get this message' } ] true
{'message':'You will never get this error!'} [] true
null [ { msg: 'You will never get this message, either' } ] false
Running second query
null [ { x: 1 } ] false
Closed

Does this seem like a bug to you?

no error when trying to query using a closed db connection

I am expecting that I would get an error if I try to make a query using a closed connection, but I dont. I'm using sql server 2008 using the freetds driver.

var db, odbc, sys;
sys = require("sys");
odbc = require("odbc");
db = new odbc.Database();
db.open("DRIVER={FreeTDS};SERVER=192.16.2.100;UID=user;PWD=pwd;DATABASE=db;TDS_Version=8.0;", function(err) {
  if (err != null) {
    throw err;
  }
  return db.close(function() {
    return db.query("select top 10 * from Users order by userid desc", function(err, rows, moreResultSets) {
      sys.debug("err:" + (sys.inspect(err)));
      sys.debug("rows:" + (sys.inspect(rows)));
      return sys.debug("more:" + (sys.inspect(moreResultSets)));
    });
  });
});

which outputs

DEBUG: err:null
DEBUG: rows:[]
DEBUG: more:false

Error running the script

Thanks for writing this module. After I installed it (from this repo) and ran the sample script, got error. Wonder why.

var util = require('util');
var odbc = require("odbc");

var db = new odbc.Database();
db.open("DRIVER={FreeTDS};SERVER=host;UID=user;PWD=password;DATABASE=dbname", function(err)
{
    db.query("select * from table", function(err, rows, moreResultSets)
    {
        util.debug(util.inspect(rows));
        db.close(function(){});
    });
});
module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: /home/jin1/projs/nodeSrv/node_modules/odbc/build/Release/odbc_bindings.node: undefined symbol: ev_default_loop_ptr
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/jin1/projs/nodeSrv/node_modules/odbc/odbc.js:25:12)
    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)

Build fails on Node.js v0.10.2

It looks like the definition of uv_after_work_cb has changed...

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' ]
make: Entering directory `/home/dbronke/devel/other/node-odbc/build'
  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::Open(const v8::Arguments&)’:
../src/odbc.cpp:306:67: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/dbronke/.node-gyp/0.10.2/src/node.h:61:0,
                 from ../src/odbc.cpp:19:
/home/dbronke/.node-gyp/0.10.2/deps/uv/include/uv.h:1411:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::Close(const v8::Arguments&)’:
../src/odbc.cpp:383:69: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/dbronke/.node-gyp/0.10.2/src/node.h:61:0,
                 from ../src/odbc.cpp:19:
/home/dbronke/.node-gyp/0.10.2/deps/uv/include/uv.h:1411:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
../src/odbc.cpp: In static member function ‘static void ODBC::UV_AfterQuery(uv_work_t*)’:
../src/odbc.cpp:399:13: warning: unused variable ‘ret’ [-Wunused-variable]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::Query(const v8::Arguments&)’:
../src/odbc.cpp:599:69: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/dbronke/.node-gyp/0.10.2/src/node.h:61:0,
                 from ../src/odbc.cpp:19:
/home/dbronke/.node-gyp/0.10.2/deps/uv/include/uv.h:1411:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::QueryAll(const v8::Arguments&)’:
../src/odbc.cpp:932:75: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/dbronke/.node-gyp/0.10.2/src/node.h:61:0,
                 from ../src/odbc.cpp:19:
/home/dbronke/.node-gyp/0.10.2/deps/uv/include/uv.h:1411:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::Tables(const v8::Arguments&)’:
../src/odbc.cpp:1007:73: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/dbronke/.node-gyp/0.10.2/src/node.h:61:0,
                 from ../src/odbc.cpp:19:
/home/dbronke/.node-gyp/0.10.2/deps/uv/include/uv.h:1411:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::Columns(const v8::Arguments&)’:
../src/odbc.cpp:1080:74: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/dbronke/.node-gyp/0.10.2/src/node.h:61:0,
                 from ../src/odbc.cpp:19:
/home/dbronke/.node-gyp/0.10.2/deps/uv/include/uv.h:1411:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetColumnValue(SQLHSTMT, Column, uint16_t*, int)’:
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_min’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_hour’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_mday’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_mon’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_year’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_wday’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_yday’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_isdst’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_gmtoff’ [-Wmissing-field-initializers]
../src/odbc.cpp:1151:28: warning: missing initializer for member ‘tm::tm_zone’ [-Wmissing-field-initializers]
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
make: Leaving directory `/home/dbronke/devel/other/node-odbc/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/dbronke/devel/other/node-odbc/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:757:12)
gyp ERR! System Linux 3.7.10-1-ARCH
gyp ERR! command "node" "/home/dbronke/devel/other/node-odbc/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /home/dbronke/devel/other/node-odbc
gyp ERR! node -v v0.10.2
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok 

code page problem

I use Hebrew code page on mysql.
English letters are Ok, however Hebrew letters come out wrong.
When I use mysql native driver all is OK.
I guess all non UFT8 code pages has the same problem.

possible memory leak

I've had what I think is a new memory leak when using your 5.14 and db2 in the last few weeks:
with db2 10.1 x64 - no leak
with db2 10.5 x64 - about 12gig of leak during 6.5 hour day - all accumulating in db2sysc process

So I thought it was strictly a db2 issue (10.5 is a new release) and nothing to do with node or odbc. And I've stayed with 10.5 because the callback times are so much better and I'm not swapping because of plenty of memory and daily reboots. But I did go back and forth there for a few days and proved it was 10.5 related.

However, when I put in your 5.19 on 7/5, the leak got a little worse. And today, with 5.20, still the same as 5.19. So could it be node or odbc somehow?

I would like to try and narrow this down to see if it's db2, node, odbc or who knows what.

And there may not be a leak at all and this could be just db2 10.5 and some new fancy buffer pool management.

At the latest node 10.12 and ubuntu 12.04.2.

I can install valgrind or whatever you think is best to resolve this.

Thanks!!

pthread_mutex_lock: Assertion Failed

When opening a large number of connections to a database, I sometimes get the following error:

node: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.

I have created a test case here:

https://gist.github.com/bf86d55118d05ae181b0

On some machines I receive the error every time I run the test case. On other machines I receive it once every couple runs. If anyone can try out the test case and report back failures, that would awesome. Also, if anyone has any idea how to fix this, that would be stellar!

Thanks,

Dan

node-odbc and DB2

Hi,

I am interested in using node-odbc with DB2. To start with I would like to run the node-odbc test-suite against DB2. Could you let me know how to run the tests.

Also is there any API doc that I can refer to for knowing the different APIs exposed by node-odbc and their functionality

Thanks in Advance

Praveen

Win32, Win64 binaries in npm

I know the windows support is immature at this point, and not entirely flushed out.. that said, it will be nice to have a target for the npm install for windows that will simply download prebuilt win32/64 binaries instead of requiring a built environment which isn't typical for windows servers.

Nice to know the windows support has continued to develop.

Date Parsing with DB2 driver

First of all, thanks for these bidings, they are proving incredibly useful.

I'm using odbc version 0.3.1 (as installed from npm)

I'm encountering difficulties parsing TIMESTAMPS coming from a IBM DB2 driver:

var res = []; db2.queryDB('select eventdate from dev.trace_table order by EVENTDATE desc fetch first row only with ur', function(results) { res = results });
undefined
res
[ { EVENTDATE: Sun, 07 Dec 1969 09:03:09 GMT } ]

When I run the same query on isql i get the correct results i.e

SQL> select eventdate from dev.trace_table order by EVENTDATE desc fetch first row only with ur
+---------------------------+
| EVENTDATE |
+---------------------------+
| 2012-04-05 07:30:19.160547|
+---------------------------+
SQLRowCount returns -1
1 rows fetched

unixodbc not used on mac osx

iODBC is included by default on osx. After installing unixodbc with brew install unixodbc, and freetds with brew install freetds --with-unixodbc, node-odbc still uses iODBC. This seems to be because it adds a -lodbc build flag, which then uses /usr/lib/libodbc.a.

I symlinked the libodbc.dylib file from the unixodbc install directory as libunixodbc.dylib, and changed the build flag to -lunixodbc and rebuilt. This caused node-odbc to use the unixodbc driver, as desired.

I'm not sure what a correct fix for this would be, but wanted to document it for anyone else who came by since it's quite complicated.

(The motivation for this was that iODBC appears to have some problems with unicode. It was working fine for most queries, until I had some strange characters in a string, after which it silently failed and sent an empty string.)

Segfault/stack smash on loooong DB2 error messages?

Hi there Dan,

Thanks for the great work on node-odbc!

Anyway, I have a peculiar problem. I am able to connect to DB2 successfully, and insert data and run queries without any problems (normally). However, the other day while testing one of my input screens, I deliberately performed a duplicate insert on a table (i.e UNIQUE key constraint violation).

Node immediately segfaults with the ol' _stack smashing detected_ error message upon performing an ODBCStatement.execute(). I can very reliably duplicate this error time and again. Other error messages are returned as expected and I can handle them. But not this one.

I have a sneaky suspicion (if you'll forgive the potential red herring) that it is to do with the extreme length of the DB2 error message (It's over 300 characters):

SQL0803N One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "3" constrains "TEST.COMPANY" from having duplicate values for the index key. SQLSTATE=23505

(this was copied from the db2 CLP after executing the same statement that creates the segfault in node)

I have tried testing this theory by creating a BEFORE INSERT trigger on a test table which throws a custom error but, alas, DB2 user error messages are limited to 70 characters, and so the error "succeeds" (i.e. no segfault).

I have no idea whether this problem lies with node, node-odbc or with unixODBC.

For now, I am working around the problem using a stored procedure to do my deletes, but it is a pain. And it makes be worry about other potential issues waiting to harass :)

System specs:

Ubuntu 12.0.4 64-bit
DB2 Express-C V10.5 64-bit, and using the 64-bit db2lib.so client library.
unixODBC 2.3.2 (compiled for 64-bit)
node-odbc 0.6.2
nodejs 0.10.23

Any pointers or suggestions would be greatly appreciated!

Many thanks and warm regards,
Riaan

P.S If any further info (test case source, etc) is required to help solve this, please shout.

Previous column value fetched for a column when its actual value is NULL

Hi,

I am using DB2 with node-odbc and found this bug where previous value is being fetched for a column if it's actual value is null in the database.

Steps to repro the issue

    a) create a table "create table foo (id integer, col1 varchar(10))"

     b) insert 2 rows as below

             insert into foo (id) values (1)
             insert into foo (id, col1) values (2, 'praveen')

     c) run the test sql-cli.js and issue the below select statement

             select * from foo

     you will see a result set as below

             [ { ID: 1, COL1: '1' }, { ID: 2, COL1: 'praveen' } ]

as you can see COL1 of the first row has a value '1' which actually had to be NULL.

Thanks

Praveen

Failing to build v0.5.14 on Windows

Built v0.4.4 successfully, but it doesn't work with unicode strings in MS SQL,
so now my hope lies with v0.5.14 by @wankdanker
I would appreciate any pointers.

Here's node-gyp output

PS C:\Users\XXX\node-test> npm install git://github.com/wankdanker/node-odbc.git

> [email protected] preinstall C:\Users\XXX\node-test\node_modules\odbc
> node-gyp configure build


C:\Users\XXX\node-test\node_modules\odbc>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.
..\src\odbc_connection.cpp(198): warning C4267: 'argument' : conversion from 'size_t' to 'SQLSMALLINT', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_connection.cpp(758): warning C4267: 'argument' : conversion from 'size_t' to 'SQLINTEGER', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_connection.cpp(765): warning C4267: 'argument' : conversion from 'size_t' to 'SQLINTEGER', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_statement.cpp(363): warning C4244: 'argument' : conversion from 'SQLLEN' to 'double', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_statement.cpp(420): warning C4244: 'argument' : conversion from 'SQLLEN' to 'double', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
C:\Users\XXX\.node-gyp\0.10.12\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
C:\Users\XXX\.node-gyp\0.10.12\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_statement.cpp(473): warning C4267: 'argument' : conversion from 'size_t' to 'SQLINTEGER', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_statement.cpp(597): warning C4267: 'argument' : conversion from 'size_t' to 'SQLINTEGER', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc_statement.cpp(664): warning C4267: 'argument' : conversion from 'size_t' to 'SQLINTEGER', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
C:\Users\XXX\.node-gyp\0.10.12\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
C:\Users\XXX\.node-gyp\0.10.12\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
C:\Users\XXX\.node-gyp\0.10.12\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
C:\Users\XXX\.node-gyp\0.10.12\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(407): error C2065: 'tm_sec' : undeclared identifier [C:\Users\No\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(407): error C2143: syntax error : missing '}' before ':' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(407): error C2143: syntax error : missing ';' before ':' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(407): error C2143: syntax error : missing ';' before ':' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(437): error C2065: 'timeInfo' : undeclared identifier [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(442): error C2065: 'timeInfo' : undeclared identifier [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(442): error C2228: left of '.tm_isdst' must have class/struct/union [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(444): error C2065: 'timeInfo' : undeclared identifier [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(483): error C2043: illegal break [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(484): error C2046: illegal case [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(506): error C2047: illegal default [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(527): error C2059: syntax error : '}' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(527): error C2143: syntax error : missing ';' before '}' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(527): error C2059: syntax error : '}' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(535): error C2143: syntax error : missing ';' before '{' [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(535): error C2447: '{' : missing function header (old-style formal list?) [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
..\src\odbc.cpp(748): warning C4244: 'argument' : conversion from 'SQLINTEGER' to 'SQLSMALLINT', possible loss of data [C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
Project : warning PRJ0018: The following environment variables were not found:
[C:\Users\XXX\node-test\node_modules\odbc\build\binding.sln]
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.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.2.9200
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\XXX\node-test\node_modules\odbc
gyp ERR! node -v v0.10.12
gyp ERR! node-gyp -v v0.10.0
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

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.