Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Srikanth.

Asked: December 15, 2016 - 8:29 pm UTC

Last updated: August 15, 2018 - 11:59 pm UTC

Version: 11.2.0.4.0 - 64bit Production

Viewed 1000+ times

You Asked

Good Evening Tom

Is it possible to merge 2 binary files using oracle PL/SQL? I have seen examples using Java but not PL/SQL.

Thanks for your time.

and Connor said...

It is easy to merge to binary objects in plsql (just by using dbms_lob), but that is *not* the same as merging to binary objects that have *structure* (eg a pdf, jpg etc etc).

These are files that have headers, footers, metadata etc. For example, in Unix if I do:

cat pic1.jpg pic2.jpg > pic3.jpg

Then pic3 will NOT be a valid file.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Structured Objects

Srikanth, January 29, 2018 - 3:24 pm UTC

Thanks for the info. Can structured objects be merged? Is there a way, using PL/SQL, to identify headers and footers?

Thanks again for your time.
Connor McDonald
January 30, 2018 - 2:44 am UTC

Not to my knowledge (ie, not without mining the header etc and hand crafting your own solutions).

In which case, I'd be exploring an external utility to do the work.

A reader, August 07, 2018 - 9:01 pm UTC

You said
"It is easy to merge to binary objects in plsql (just by using dbms_lob), but that ....."

Does this mean a dbms_lob merge will also result the same way as the "cat" output for these structured files?
Connor McDonald
August 15, 2018 - 11:59 pm UTC

That is my understanding

More to Explore

CLOB/BLOB/etc

Complete documentation on Securefiles and Large Objects here