How to select part of blob field in Oracle?

I have a table in Oracle that stores files as arrays of bytes in a BLOB field. I want my client to be able to load a saved file into small pieces (as opposed to downloading all of this right away), so I can display a progress bar.

How to write an Oracle query that retrieves only part of the contents of a BLOB field? I assume it will be something like this:

SELECT PARTOF(BLOBFIELD, 1000, 2000) AS CHUNK FROM tbl WHERE ID = 1 

if I want to get 1000 bytes from BLOBFIELD starting from byte 2000.

As a minor question, are there any performance issues? If Oracle would load the entire BLOB field into memory to return part of it, it would not be a very good idea.

+6
oracle
source share
1 answer
+6
source share

All Articles