title: Divide Oracle CLOB to Multiple JSON with Node JS
body: <p>I am trying to convert a Single Oracle CLOB data into Multiple JSON file with Node js. I have used <code>oracledb.fetchAsString = [ oracledb.CLOB ];</code> to fetch Oracle CLOB data. Here is my Node js code - </p>
  
  <pre><code>const express = require ('express');
  const app = express ();
  const port = 8080;
  const dbConfig = require ('./db.js');
  const oracledb = require ('oracledb');
  
  
  app.get ('/', (req, res) =&gt; {
    var jsonstring;
    oracledb.getConnection (dbConfig, function (err, connection) {
      if (err) throw err;
      oracledb.fetchAsString = [ oracledb.CLOB ];
      connection.execute (
        'select topic from table',
        {},
        function (err, result) {
          if (err) { console.error(err.message); return; }
        if (result.rows.length === 0)
          console.error("No results");
  
        else {
          var clob = result.rows[0][0];
          console.log(clob);
  
        }
          });
        }
      );
    });
  
  app.listen (port, () =&gt; console.log (`Example app listening on port ${port}!`));
  </code></pre>
  
  <p>And Here is my console output - </p>
  
  <pre><code>{"Data":[{"Country":"A","OrderNo":"1","Method":" indoor ","WorkOrderNo":"1","Zipcode":"3","OriginalTimeSlot":"2019-12-","CurrentTimeSlot":"2019-12-13","Status":"","WOCreationDate":"2019-11-09","ModifactionDate":"2019-12-11","Dispatch":{"Status":"00","DispatchUnit":[]},"Par":{"Parcel":[{"Active":true,"Weight":284.572,"Volume":0.68,"Trackingstatus":"","Number":"1"},{"Active":true,"Weight":5.396,"Volume":0.01,"Trackingstatus":"","Number":"16"},{"Active":true,"Weight":362.777,"Volume":0.831321,"Trackingstatus":"","Number":"162"}]},"TimeSlotId":"7a2bb6eb-b7a2-4033-8485-0df4015a3938"},{"Country":"B","OrderNo":"162570460","Method":"customer ","WorkOrderNo":"2","Zipcode":"2","OriginalTimeSlot":"2019-11-21","CurrentTimeSlot":"2019-11-21","Status":"90","WOCreationDate":"2019-11-17","ModifactionDate":"2019-12-11","Dispatch":{"Status":"20","DispatchUnit":[{"Unit":"017","Time":"2019-11-20"}]},"Par":{"Parcel":[{"Active":true,"Weight":12.271,"Volume":0.047,"Trackingstatus":"90","Number":"00935297810003971677"},{"Active":true,"Weight":14.668,"Volume":0.038042,"Trackingstatus":"90","Number":"00935297810003971684"}]},"TimeSlotId":"e3fe1936-64f9-42de-b2c4-0ddf00529720"}]}
  </code></pre>
  
  <p>Now I want to create 2 different JSON file from this output like below - </p>
  
  <p>JSONFILE1:</p>
  
  <pre><code>{"Country":"A","OrderNo":"1","Method":" indoor ","WorkOrderNo":"1","Zipcode":"3","OriginalTimeSlot":"2019-12-","CurrentTimeSlot":"2019-12-13","Status":"","WOCreationDate":"2019-11-09","ModifactionDate":"2019-12-11","Dispatch":{"Status":"00","DispatchUnit":[]},"Par":{"Parcel":[{"Active":true,"Weight":284.572,"Volume":0.68,"Trackingstatus":"","Number":"1"},{"Active":true,"Weight":5.396,"Volume":0.01,"Trackingstatus":"","Number":"16"},{"Active":true,"Weight":362.777,"Volume":0.831321,"Trackingstatus":"","Number":"162"}]},"TimeSlotId":"7a2bb6eb-b7a2-4033-8485-0df4015a3938"}
  </code></pre>
  
  <p>JSONFILE2:</p>
  
  <pre><code>{"Country":"B","OrderNo":"162570460","Method":"customer ","WorkOrderNo":"2","Zipcode":"2","OriginalTimeSlot":"2019-11-21","CurrentTimeSlot":"2019-11-21","Status":"90","WOCreationDate":"2019-11-17","ModifactionDate":"2019-12-11","Dispatch":{"Status":"20","DispatchUnit":[{"Unit":"017","Time":"2019-11-20"}]},"Par":{"Parcel":[{"Active":true,"Weight":12.271,"Volume":0.047,"Trackingstatus":"90","Number":"00935297810003971677"},{"Active":true,"Weight":14.668,"Volume":0.038042,"Trackingstatus":"90","Number":"00935297810003971684"}]},"TimeSlotId":"e3fe1936-64f9-42de-b2c4-0ddf00529720"}
  </code></pre>
  
  <p>How can I divide like this? </p>