node-oracle icon indicating copy to clipboard operation
node-oracle copied to clipboard

execute not call back.....

Open oneroundseven opened this issue 10 years ago • 4 comments

i have install oracle on win7 64bit

code below :

var DB = {},
    connectData = {
    hostname : 'ip',
    port : 1521,
    database : 'oracle',
    user : 'oracle',
    password : 'pw'
};

DB.query = function(sql, callback) {
    oracle.connect(connectData, function(err, connection) {
        console.log(connection.isConnected())
        if (err) { console.log('Error connecting to db:' + err); return; }
        connection.execute(sql, [], function(err, results) {
            if (err) { console.log("Error executing query:", err); return; }
            callback && callback(results);
            connection.close(); // call only when query is finished executing
        });
    });
}

connection.isConnected() // true

the execute method can not call back .... and not any error console

oneroundseven avatar Jan 13 '15 08:01 oneroundseven

I had this same problem when I first started, same setup: win 7, 64 bit, Oracle 11gR2. It turned out to be an environment variable issue, and I somehow pulled the answer out of issues #90, #72, and #154.

For Windows 7 64-bit, DO NOT include the "c:\instantclient_12_1\vc10" path in the PATH variable as Install.md instructs. That section of your path env var should look like:

Path=C:\Python27\;C:\instantclient_12_1;C:\oracle\product\11.2.0\dbhome_1\bin;

SegFault0x0 avatar Jan 14 '15 00:01 SegFault0x0

@iGeechee
Thank you for your answer.

i found i don't config the python27 environment variable and i config it this run well

thank you!

oneroundseven avatar Jan 14 '15 01:01 oneroundseven

I think the best we can add the Notes in install.md, python is not installed by default configuration environment variable

oneroundseven avatar Jan 14 '15 01:01 oneroundseven

Glad I could help! Good thing I left Python's path in there, I was actually going to remove it prior to posting.

SegFault0x0 avatar Jan 15 '15 16:01 SegFault0x0