title: How to tweak LISTAGG to support more than 4000 character in select query?
body: <p>Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production.</p>
  
  <p>I have a table in the below format.</p>
  
  <pre><code>Name     Department
  Johny    Dep1
  Jacky    Dep2
  Ramu     Dep1
  </code></pre>
  
  <p>I need an output in the below format.</p>
  
  <pre><code>Dep1 - Johny,Ramu
  Dep2 - Jacky
  </code></pre>
  
  <p>I have tried the 'LISTAGG' function, but there is a hard limit of 4000 characters. Since my db table is huge, this cannot be used in the app. The other option is to use the</p>
  
  <pre><code>SELECT CAST(COLLECT(Name)
  </code></pre>
  
  <p>But my framework allows me to execute only select queries and no PL/SQL scripts.Hence i dont find any way to create a type using "CREATE TYPE" command which is required for the COLLECT command. </p>
  
  <p>Is there any alternate way to achieve the above result using select query ?</p>