node.js - How to get database name in oracle db in node js without query using connection object -
how database name in oracle db node js
var oracledb = require('oracledb'); oracledb.getconnection( { user: 'c##root', password: 'root', connectstring: 'localhost:1521/orcl' }, function (err, connection) { if (err) { console.log('error while connect oracledb :' + err.stack); return; } else { console.log("database connected") connection.execute("insert person (name) values ( :name) ", ['doe'], function (err, result) { if (err) { console.error(err); return; } else { console.log("value sucessfully added database: " + "'database name here'") } }); } });
i want name of database when each time execute particular query.
see how find oracle service name
select sys_context('userenv','service_name') dual;
ps in given code, orcl
service name, not sid.
Comments
Post a Comment