Question: I am trying to pull data from an Oracle DB using Oracle Driver (1.4.0) for NodeJS-4.2.2, Express (4.13.3). 

I am able to write the output to a stream (file), but not able to assign that to a variable object. Below is the code snippet. Anyway that I assign the clob field output to a var ? 

```
{
                    if (err) { console.error(err.message); return; }
                    if (result.rows.length === 0) { console.log("No results"); return; }

                    var clobe = "";
                    var lob = result.rows[2][1];
                    if (lob === null) { console.log("BLOB was NULL"); return; }

                   // lob.setEncoding('utf8');
                    lob.on(
                        'end',
                        function()
                        {
                            console.log("lob.on 'end' event");
                            res.end();
                        });
                    lob.on(
                        'close',
                        function()
                        {
                            console.log("lob.on 'close' event");
                            connection.release(function(err) {
                                if (err) console.error(err);
                            });
                        });
                    lob.on(
                        'error',
                        function(err)
                        {
                            console.log("lob.on 'error' event");
                            console.error(err);
                        });
                    lob.on('data', function (chunk) { clobe += chunk; console.log("Added chunk("+chunk.length+") to clob("+clobe.length+")");});

                    res.writeHead(200, {'Content-Type': 'application/json' });

                    lob.pipe(res);
                }

```

Answer: 
use 

```
  oracledb.fetchAsString = [ oracledb.CLOB ];

```

and your CLOB will be retrieved as a string

[Docs](https://blogs.oracle.com/opal/node-oracledb-112:-working-with-lobs-as-string-and-buffer-connection-pinging)
```
    if (lob === null) { 
      console.log("CLOB was NULL");
      return;
    }
    var clob = "";
    lob.setEncoding('utf8');  // we want text, not binary output

    lob.on('end', function() {
      console.log("lob.on 'end' event ", clob);
    });
    lob.on('close', function() {
      console.log("lob.on 'close' event");
    });
    lob.on('error', function(err) {
      console.log("lob.on 'error' event");
      console.error(err);
    });
    lob.on('data', function (chunk) { 
      clob += chunk;
      console.log("Added chunk("+chunk.length+") to clob("+clob.length+")");
    });

```