0

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

1
  • How was the data compressed? How was it stored in the BLOB column? Did you use utl_compress, for example, to compress the data? Or was the data compressed outside of PL/SQL? If so, what algorithm was used? Commented Oct 23, 2012 at 14:32

1 Answer 1

1

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.