Nathan Stanford
Nathan Stanford

Reputation: 1394

How can one convert an image file stored as a clob into a blob and insert it into a different table?

Using Oracle

How can one convert an image file stored as a clob into a blob and insert it into a different table?

I already have code pulling a blob image out and displaying it on my website but I cannot figure out how to get the clob and convert to blob so I can put it in the new scheme and table I need too.

Upvotes: 0

Views: 2709

Answers (1)

asafm
asafm

Reputation: 921

Oracle provides a build in package called DBMS_LOB that handles most LOB operations, one of the methods in this package is DBMS_LOB.CONVERTTOBLOB http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1020355

Please mind that sometimes you'll need to specify the CHARSET.

you can look at the example here: http://arjudba.blogspot.com/2008/04/convert-clob-to-blob.html

If this wasn't helpful you can always use UTL_RAW

Upvotes: 1

Related Questions