aviad
aviad

Reputation: 8278

How to retrieve text stored in BLOB column in ORACLE 11g using SQL?

I have compressed json text stored in BLOB column in Oracle 11g.

Is it possible to retrieve it using SQL only?

EDIT:

AFAIK the data was compressed on Linux OS using ZLIB and loaded using dbms_lob.loadfromfile

Upvotes: 0

Views: 1103

Answers (1)

Justin Cave
Justin Cave

Reputation: 231851

Oracle doesn't provide any built-in functions that would uncompress a ZLIB-compressed stream (though utl_compress uses very, very similar algorithms).

You would realistically need to load one of the various Java libraries that uncompresses a ZLIB-compressed stream into the database, write a bit of code to wrap that library, and then call that library from SQL. This wouldn't be a pure SQL implementation.

If you're really ambitious, it should be possible to implement the DEFLATE algorithm in pure SQL though that would likely be exceedingly painful SQL to write (or debug or maintain).

Upvotes: 1

Related Questions