How to get a complete hexadecimal value from blob datatype?
<p>I am trying to get an hexadecimal value from a BLOB column from Java using a query so:</p>

<pre><code>SELECT RAWTOHEX(UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(thumbnail, 2000,1))) thumbnail FROM thumbnails  
</code></pre>

<p>if I use the next query:</p>

<pre><code>SELECT LENGTH(thumbnail) FROM thumbnails 
</code></pre>

<p>the byte length of all thumbnails are over 6000 bytes</p>

<p>the first query it works because I am giving it 2000 bytes because that is the size of varchar2 file type:</p>

<p>How can I modify the query to get all the thumbnail (all characters) and not only 2000 characters? or another way to get hexadecimal complete from a blob value?</p>