title: SQL truncate clob field
body: <p>In Oracle I have a query similar to:</p>
  
  <pre><code>CREATE TABLE my_table
  (
      my_field CLOB,
      my_field2 VARCHAR2(50 CHAR),
      my_field3 VARCHAR2(5 CHAR),
  )
  </code></pre>
  
  <p>and I would like to run this query:</p>
  
  <pre><code>select count(*)
  from my_table
  where my_field = substr('...',4000,1)
  </code></pre>
  
  <p>When I run the query, I get an error:</p>
  
  <blockquote>
    <ol start="1704">
    <li>00000 -  "string literal too long"<br>
    *Cause:    The string literal is longer than 4000 characters.<br>
    *Action:   Use a string literal of at most 4000 characters.<br>
           Longer values may only be entered using bind variables.</li>
    </ol>
  </blockquote>
  
  <p>Please advice!</p>