Skip to content

ExecuteMany() Method Missing #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Stoley777 opened this issue May 1, 2019 · 6 comments
Closed

ExecuteMany() Method Missing #1089

Stoley777 opened this issue May 1, 2019 · 6 comments
Labels

Comments

@Stoley777
Copy link

Hey I noticed that in my oracledb installation, the ExecuteMany() function is not available.

Is there any way to install the files (maybe Typescript?) needed to use the method/function manually? OracleDB is already installed, and I can connect to my DB's, I'm just not sure why the ExecuteMany() function wouldn't be installed?

Answer the following questions:

  1. What is your Node.js version: v8.11.3 64-bit

  2. What is your node-oracledb version: 3.1.2

  3. What OS (and version) is Node.js executing on: win32

  4. What is your Oracle client (e.g. Instant Client) version: use 11.2.0.4.0? 64-bit installed on the C drive.

  5. What is your Oracle Database version: 11.2.0.4.0

  6. What is the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) set to? On macOS, what is in ~/lib? Not sure

@anthony-tuininga
Copy link
Member

Can you share your code? The method name is executeMany() -- note the case of the name. You can see the documentation for this method here.

@Stoley777
Copy link
Author

Sure - I when I hover over execute() for example, I can get a definition in a typescript file. When i hover over executeMany(), no such definition. So I'm thinking the 'class' is not installed. I was thinking if the 'class' typescript source code exists in github, maybe I could just copy the file into the 3.4.3 type folder and it would be fixed?

Code

var oracledb = require("oracledb");
var dbConfig = require("C:/node_modules/oracledb/examples/dbconfig.js");

var sql = "INSERT INTO mytab VALUES (:a, :b)";

var binds = [{ a: 1, b: "One" }, { a: 2, b: "Two" }, { a: 3, b: "Three" }];

var options = {
  autoCommit: true,
  bindDefs: {
    a: { type: oracledb.NUMBER },
    b: { type: oracledb.STRING, maxSize: 5 }
  }
};
connection = oracledb.getConnection({
  user: dbConfig.user,
  password: dbConfig.password,
  connectString: dbConfig.connectString
});

connection.executeMany(sql, binds, options, function(err, result) {
  if (err) {
    console.error(err);
  } else {
    console.log(result); // { rowsAffected: 3 }
  }
});

Debugger attached.
c:\exemany.js:21
connection.executeMany(sql, binds, options, function(err, result) {
^

TypeError: connection.executeMany is not a function
at Object. (c:\exemany.js:21:12)
at Module._compile (module.js:649:14)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3

@anthony-tuininga
Copy link
Member

anthony-tuininga commented May 1, 2019

node-oracledb currently doesn't have an official Typescript definition file -- so you'll have to contact whoever created the Typescript definition file you are using and see if they can include executeMany(), or add it yourself!

@cjbj
Copy link
Member

cjbj commented May 1, 2019

The typescript file is out of date. You could submit a PR with an update if you like.
See #169

@cjbj cjbj closed this as completed May 1, 2019
@cjbj
Copy link
Member

cjbj commented May 1, 2019

If it's not clear: you should still be able to call executeMany()

@Stoley777
Copy link
Author

thanks, I was going mental over misunderstanding typescript... curse my .NET background............ Thank you guys!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants