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.
How can I write an Oracle query that retrieves only part of the contents of a BLOB field? I imagine it would be something like this:
SELECT PARTOF(BLOBFIELD, 1000, 2000) AS CHUNK FROM tbl WHERE ID = 1
if I wanted to get 1000 bytes from BLOBFIELD starting at byte 2000.
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.
Can you use DBMS_LOB.READ (lob_loc, amount, offset, buffer)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With