title: Stuck with the oracle Ref cursor in Node.js
body: <p>I am using oracle database with Node.js. I am calling a Stored procedure from Node.js that returns multiple REF cursors. When I am trying to fetch the rows from cursor it is giving some absurd integer value. Here is my code...</p>
  
  <pre class="lang-js prettyprint-override"><code>async function retrievePNRContext(req, res) {
      const reservationInfo = req.body.ReservationInfo;const p_series_num = reservationInfo.SeriesNumber;
      const p_confirmation_num = reservationInfo.ConfirmationNumber;const p_last_load_guid = uuid.v1();
      const p_view_only = "false";const p_reservation_required = "true";const p_payment_required = "true";
      const p_oa_flights_required = "true";const p_comments_required = "true";const p_history_required = "true";
      const p_segments_required = "true";const p_person_required = "true";const p_segment_person_map_required = "true";
      const p_seat_assignments_required = "true";const p_apis_info_required = "true";const p_price_info_required = "true";
      const p_charge_required = "true";const p_res_payment_map_required = "true";const p_physical_flt_info_required = "true";
      const p_res_contacts_required = "true";const p_contact_info_required = "true";const p_cpginprogress_pmnt_required = "true";
      const p_group_name_override_flag = 0;const p_block_pnr_retrieval_flag = 0;const p_reservation = oracledb.CURSOR;const p_payment = oracledb.CURSOR;
      const p_oa_flights = oracledb.CURSOR;const p_comments = oracledb.CURSOR;const p_history = oracledb.CURSOR;const p_segments = oracledb.CURSOR;
      const p_person = oracledb.CURSOR;const p_segment_person_map = oracledb.CURSOR;const p_seat_assignments = oracledb.CURSOR;const p_apis_info = oracledb.CURSOR;
      const p_price_info = oracledb.CURSOR;const p_charge = oracledb.CURSOR;const p_res_payment_map = oracledb.CURSOR;const p_physical_flight_Info = oracledb.CURSOR;
      const p_res_contacts = oracledb.CURSOR;const p_contact_info = oracledb.CURSOR;const p_cpginprogress_payment = oracledb.CURSOR
      try {
          oracledb.prefetchRows = 10000;oracledb.maxRows = 400000;oracledb.fetchArraySize = 10000000;
          connection = await oracledb.getConnection(dbconfig);
          console.log(dbconfig);
          console.log('Connection successful');
          var sql ='BEGIN KRISHNA_TEST.SP_RETRIEVE_RESERVATION(:p_series_num, :p_confirmation_num, :p_last_load_guid, :p_view_only,\
   :P_reservation_required, :P_payment_required, :P_oa_flights_required, :p_comments_required, :p_history_required, :p_segments_required,\
   :p_person_required, :p_segment_person_map_required, :p_seat_assignments_required, :p_apis_info_required, :p_price_info_required, :p_charge_required,\
   :p_res_payment_map_required, :p_physical_flt_info_required, :p_res_contacts_required, :p_contact_info_required, :p_cpginprogress_pmnt_required, :p_group_name_override_flag,\
   :p_block_pnr_retrieval_flag, :p_reservation, :p_payment, :p_oa_flights, :p_comments, :p_history, :p_segments, :p_person, :p_segment_person_map, :p_seat_assignments, \
   :p_apis_info, :p_price_info, :p_charge, :p_res_payment_map, :p_physical_flight_info, :p_res_contacts, :p_contact_info, :p_cpginprogress_payment); END;';
   var bindvars = {
              p_series_num: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_series_num },
              p_confirmation_num: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_confirmation_num },
              p_last_load_guid: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_last_load_guid },
              p_view_only: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_view_only },
              P_reservation_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_reservation_required },
              P_payment_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_payment_required },
              P_oa_flights_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_oa_flights_required },
              p_comments_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_comments_required },
              p_history_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_history_required },
              p_segments_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_segments_required },
              p_person_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_person_required },
              p_segment_person_map_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_segment_person_map_required },
              p_seat_assignments_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_seat_assignments_required },
              p_apis_info_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_apis_info_required },
              p_price_info_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_price_info_required },
              p_charge_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_charge_required },
              p_res_payment_map_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_res_payment_map_required },
              p_physical_flt_info_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_physical_flt_info_required },
              p_res_contacts_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_res_contacts_required },
              p_contact_info_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_contact_info_required },
              p_cpginprogress_pmnt_required: { type: oracledb.STRING, dir: oracledb.BIND_IN, val: p_cpginprogress_pmnt_required },
              p_group_name_override_flag: { type: oracledb.NUMBER, dir: oracledb.BIND_IN, val: p_group_name_override_flag },
              p_block_pnr_retrieval_flag: { type: oracledb.NUMBER, dir: oracledb.BIND_IN, val: p_block_pnr_retrieval_flag },
              p_reservation: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_payment: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_oa_flights: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_comments: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_history: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_segments: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_person: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_segment_person_map: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_seat_assignments: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_apis_info: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_price_info: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_charge: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_res_payment_map: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_physical_flight_Info: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_res_contacts: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_contact_info: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 },
              p_cpginprogress_payment: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT, maxSize: 10000000 }
          };
          await connection.execute(sql, bindvars, function (err, result) {
              if (err) console.log(err.message);
              const rows = result.outBinds['p_reservation'];
              console.log(rows);
              rows.getRows(numRows, function (err, row) {
                  if (err) console.log(err.message);
                  row.forEach(r =&gt; console.log(r));
              });        
  
          });       
      }
      catch (err) {
          console.log(err);
      }
      finally {
          //cleanup
      }
  
  };
  </code></pre>
  
  <p>Please let me know how to get rows from cursor in Node.js..Thanks in advance!!</p>