title: node-oracledb error when executing stored procedure NJS-012
body: <p>I'm running Node 8.9.4, Hapi 17.4, and Oracledb 2.2.</p>
  
  <p>When attempting to call a stored procedure, I get the error "NJS-012: encountered invalid bind data type in parameter 2".  Nothing I've been able to do seems to fix the issue.  The code that calls the procedure is:</p>
  
  <pre><code>async function getSavedViews(req, h, server) {
      let connection = await server.app.db.getConnection();
  
      let bindVars = {
          P_USER_NAME:   req.payload.user_name,
          P_CONTENT_TYPE: req.payload.content_type,
          P_PROJECT_NUMBER: req.payload.project_number,
          OP_GRID_TAB_TYP: { dir: server.app.db.BIND_OUT, type: server.app.db.ARRAY } 
      }
  
      let res = server.methods.response();
  
      try {
          res.error = false;
          res.msg = "Retrieved saved views.";
          res.data = await connection.execute(
              `BEGIN APPS.XXETA_GRID_USER_CONTEXT_PKG.EXTRACT_GRID_DETAILS(:P_USER_NAME, :P_CONTENT_TYPE, :P_PROJECT_NUMBER, :OP_GRID_TAB_TYP); END;`,
              bindVars
          );
      } catch (err) {
          server.app.logger.error(err.message);
          res.error = true;
          res.msg = err.message,
          res.data = [];
      }
  
      return res;
  }
  </code></pre>
  
  <p>The stored procedure is described as:</p>
  
  <p><a href="https://i.stack.imgur.com/Qfe2F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qfe2F.png" alt="Oracle Screenshot"></a></p>
  
  <p>The error I get from my logger is: 2018-08-06 15:02:20 ERROR NJS-012: encountered invalid bind data type in parameter 2</p>
  
  <p>Any help would be appreciated.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The complex type that is the bound out variable looks like this...</p>
  
  <pre><code>CREATE OR REPLACE TYPE XXETA_GRID_CONTEXT_REC_TYP AS OBJECT
     (
          GRID_VIEW_ID NUMBER (15),
          GRID_VIEW_NAME VARCHAR2 (240),
          USER_NAME VARCHAR2 (30),
          PROJECT_NUMBER  VARCHAR2 (5)
     )
  </code></pre>