title: How do I select part of a BLOB field in Oracle?
body: <p>I have a table in Oracle that stores files as byte arrays in a BLOB field.  I want my client to be able to download the stored file in small chunks (as opposed to downloading the whole thing all at once) so I can display a progress bar.</p>
  
  <p>How can I write an Oracle query that retrieves only <em>part</em> of the contents of a BLOB field?  I imagine it would be something like this:</p>
  
  <pre><code>SELECT PARTOF(BLOBFIELD, 1000, 2000) AS CHUNK FROM tbl WHERE ID = 1
  </code></pre>
  
  <p>if I wanted to get 1000 bytes from BLOBFIELD starting at byte 2000.</p>
  
  <p>As a secondary question, are there any performance issues with this?  If Oracle has to load the entire BLOB field into memory in order to return part of it, then this wouldn't be a very good idea.</p>