Question

I am importing data from an Oracle DB that is neither made nor administered by myself.

There might be some BLOB fields in that data.

Assuming that the field title is not a good description for the field's contents and that there is no blob_type field, is there anyway to know or guess what kind of binary data is being stored?

Basically, how do I tell the difference between an image stored in a BLOB field versus perhaps a large amount of text.

I suppose this is less of an Oracle BLOB thing and more of a 'how do I parse and interpret binary data with no prior info' thing.

I apologize, this is either a strange question or a rather silly one and the answer is probably 'No', but I figured I'd ask anyway.

If it helps, I plan to use cx_Oracle with Python to do the import, though I doubt that's relevant.

Thanks for your time, have a good day.

Was it helpful?

Solution

Oracle database doesn't really have any mechanisms for rendering a BLOB as anything other than a raw string so it has no interest in being able to figure out whether it is a Word document or Angry Birds for iOS6.

Having said which, you could investigate Oracle's MultiMedia functionality. Storing the blobs as ORDSource objects rather than BLOBs might allow you to do some probing of their contents. Find out more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top