Home » SQL & PL/SQL » SQL & PL/SQL » How to turn image files into blob
How to turn image files into blob [message #394053] Wed, 25 March 2009 09:47 Go to next message
registereduser
Messages: 52
Registered: June 2008
Location: Toronto
Member
I have opposite question:

How to turn image files into blob? Let me say, there are total 100 JPG files. I have created a table T_Image which has two columns. Col_1 would be varchar2 to story the original file name without ".JPG" and Col_2 would be blob.

Could someone give me a single solution or indication what should I read?

My background: just passed OCA PL/SQL Developer tests and do not have real Oracle work experience.

Many thanks.
Re: How to turn image files into blob [message #394056 is a reply to message #394053] Wed, 25 March 2009 10:13 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Option1: BFILE This i a LOB data type that references data that is stored by the OS, rather tahan by the database.
Think of it as a pointer from the DB to a file on disk.
More Details

Option 2)
Have a colum of type BLOB, and use UTL_FILE to read the raw data into that column.

Re: How to turn image files into blob [message #394080 is a reply to message #394056] Wed, 25 March 2009 11:47 Go to previous messageGo to next message
registereduser
Messages: 52
Registered: June 2008
Location: Toronto
Member
Thanks a lot. Your indication is very clear.

Let us assume further. If these image files are going to retrieved online, I guess the internal blob column has advantage in terms of transation time. Am I right?

Re: How to turn image files into blob [message #394238 is a reply to message #394080] Thu, 26 March 2009 04:48 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
There's no great performance difference between them as far as I know - the same quantity of data nneds to be read from disk in both cases. If the images were small, then it's possible that they might be cached as Blobs.

The main differences are that Bfiles are not part of the database - hence they do not increase the size of your backups, and neither do changes to them generate redo.
On the downside, in the event of a recovery situation, they will not be restored froman Oracle backup.
Re: How to turn image files into blob [message #394285 is a reply to message #394238] Thu, 26 March 2009 06:45 Go to previous message
registereduser
Messages: 52
Registered: June 2008
Location: Toronto
Member
Brilliant. Very insightful information.
Previous Topic: how to generate the batch number based on number of records
Next Topic: search a whole table
Goto Forum:
  


Current Time: Wed Dec 07 04:57:38 CST 2016

Total time taken to generate the page: 0.12284 seconds