Last few weeks I had been trying to connect oracle db from my nodejs code. What I found so far are 2 main libraries such as https://github.com/mariano/node-db-oracle which i
From what I understand, Set PATH puts the string you specified at the beginning of your Path environment variable. I entered the instant client folder path at the beginning.
C:\oraclexe\app\oracle\instantclient_12_1;
It fixed the oracle binding error, but the queries wouldn't work. Then, I added the vc11 folder path BEFORE the instant client path, so it looks like this :
C:\oraclexe\app\oracle\instantclient_12_1\vc11;C:\oraclexe\app\oracle\instantclient_12_1;
Now my queries work!
Did you get the Instant Client as described here? If I'm reading this correctly, you need the Basic (or Basic Lite) and SDK Instant Client packages. The SDK package might have the header file you're having trouble with.
Side note: in my experience, you don't always need to add Instant Client to PATH
; you can usually get away with just making sure your executable can find it (which often means just dropping it in the same directory).
Set the oracle client path in the command prompt like below before starting the Node application
Set PATH=C:\oraclexe\app\oracle\instantclient_12_1;%PATH%
I had the above problem , this resolved mine and I am now able to connect to oracle .
But the one problem I am still facing is executing the select statement .It always returns error. I am able to execute SP, create statements and everything else without error . I am stuck here and sort of disappointed .
I know this is an old post... just wanted to mention a sure way for nodejs to communicate to oracle without extra modules.
Set up oracle so it can create and receive http requests. There are a few ways to do this:
The easiest is to turn on the epg gateway:
Also you can setup modplsq:
or the Apex listener:
Then in node js do a standard http.get:
http.get("http://localhost/accessor/myschema.my_procedure?x=1&y=2", function(res) {
console.log("Got response: " + res.statusCode);
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
Whichever approach...secure oracle so that it will only respond to the ip address of the nodejs server. So if running on localhost:
if owa_util.get_cgi_env('REMOTE_ADDR') = '127.0.0.1' then
--ok
else
-- fail
end if;
Also block calls to every other package and procedure. There are few ways to do this depending on the path you take.
Make sure you do this at a minimum:
There you have it...no need to worry if a module will break or stop working with the next release.
AND...you can easily communicate from Oracle to Node use: