title: Unable to insert using executeMany() into Oracle DB with Node.js
body: <p>I am trying to insert data into Oracle database via Node JS. I am receiving data from Rest API. I am getting below error while running the code - </p>
  
  <pre><code>Error: NJS-005: invalid value for parameter 2
  </code></pre>
  
  <p>Here is my JSON Data getting from API - </p>
  
  <pre><code>[{ "id": 6, "type": "LOOKUP_ID", "value": "A", "description": "Access Group A", "instime": "2016-06-30", "updtime": null, "deltime": null, "insuser": "ADMIN", "upduser": null, "deluser": null },
   { "id": 5, "type": "LOOKUP_ID", "value": "B", "description": "Access group for B", "instime": "2016-03-07", "updtime": null, "deltime": null, "insuser": "ADMIN", "upduser": null, "deluser": null }, 
   { "id": 7, "type": "LOOKUP_ID", "value": "C", "description": "Access Group for C", "instime": "2017-07-11", "updtime": null, "deltime": null, "insuser": "ADMIN", "upduser": null, "deluser": null }, 
   { "id": 10, "type": "LOOKUP_ID", "value": "M", "description": "Access Group for M", "instime": "2018-02-28", "updtime": null, "deltime": null, "insuser": "ADMIN", "upduser": null, "deluser": null }];
  </code></pre>
  
  <p>Here is my Node JS code - </p>
  
  <pre><code>'use strict';
  
  const oracledb = require('oracledb');
  const express = require('express');
  var request = require("request")
  const app = express();
  
  
  app.get('/', (req, res) =&gt; {
      oracledb.getConnection(
          {
              user: 'uid',
              password: 'passwd',
              connectString:
                  '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost)(PORT=1521)(SEND_BUF_SIZE=)(RECV_BUF_SIZE=))(LOAD_BALANCE=yes))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=dbhost)))',
          },
          connExecute
      );
  
       function connExecute(err, connection) {
          if (err) {
              console.error(err.message);
              res.send(err.message);
              return;
          }
          var url = "http://localhost:8080/api/employees"
  
          request({
              url: url,
              json: true
          }, async function (error, response, body) {
              try {
                  if (!error &amp;&amp; response.statusCode === 200) {
  
                      const data = JSON.stringify(body);
                      const sql = `INSERT INTO TABLE 
                      (ID, TYPE, VALUE, DESCR, INS, UPD, DELE, USER_INS, USER_UPD, USER_DELE) 
                      VALUES 
                  (:id, :type, :value, :description, :instime, :updtime, 
                      :deltime, :insuser, :upduser, :deluser )`;
  
                      const binds = data;
  
                      const options = {
                          autoCommit: true,
                          bindDefs: {
                              id: { type: oracledb.NUMBER },
                              type: { type: oracledb.STRING, maxSize: 50 },
                              value: { type: oracledb.STRING, maxSize: 100 },
                              description: { type: oracledb.STRING, maxSize: 200 },
                              instime: { type: oracledb.DATE },
                              updtime: { type: oracledb.DATE },
                              deltime: { type: oracledb.DATE },
                              insuser: { type: oracledb.STRING, maxSize: 255 },
                              upduser: { type: oracledb.STRING, maxSize: 255 },
                              deluser: { type: oracledb.STRING, maxSize: 255 }
                          }
                      };
  
                      const result = await connection.executeMany(sql, binds, options);
  
                      console.log(result.rowsAffected);
                  }
                  } catch (error) {
                      console.log(error.message);
                  }
          })
      }
  
      function connRelease(connection) {
          connection.close(function (err) {
              if (err) {
                  console.error(err.message);
              }
          });
      }
  });
  
  const PORT = process.env.PORT || 8000;
  app.listen(PORT, () =&gt; {
      console.log(`App listening on port ${PORT}`);
      console.log('Press Ctrl+C to quit.');
  });
  
  module.exports = app;
  </code></pre>
  
  <p>Here is my Table Structure - </p>
  
  <p><a href="https://i.stack.imgur.com/7DZfs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7DZfs.png" alt="Table Structure"></a></p>
  
  <p>I am not able to figure out what wrong I am doing here. Need some help to fix the issue.</p>