Re: Inserting BLOBs from files with the filename stored in another column

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 26 Oct 2012 11:11:20 +0100
Message-ID: <Sa2dnZVW-Jgw_BfNnZ2dnUVZ8jOdnZ2d_at_bt.com>


Here's an example of the type of code needed to get a BLOB returned by a function call, but I'm not sure that you could use the return value in a simple update statement - mainly because this isn't the way I've loaded BLOBs into tables in the past.
http://technologydribble.info/tag/load-blob-from-file/

The code I've used in the past is similar to the above, but is based on single row processing, starting with an empty_blob() in the blob column.

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com/all_postings

Author: Oracle Core (Apress 2011)
http://www.apress.com/9781430239543

<leichtenfels_at_gmail.com> wrote in message news:3c3894bb-9a91-42a3-9e06-2b0fa0526298_at_googlegroups.com...
| Am Freitag, 26. Oktober 2012 10:39:04 UTC+2 schrieb Jonathan Lewis:
| > I assume the problem is finding code that allows you to read the list
of
| > files from the directory.
|
| Actually my problem is iterating through the table and loading the file
into the BLOB column. As the file name is stored in a column I don't need to process the list of files (though this would be certainly doable).
|
| This may be a basic question, but I'm looking for something along the
lines of
|
| UPDATE ARTICLES SET IMAGE = LOAD_IMAGE_FILE(IMG_FILENAME);
|
| where LOAD_IMAGE_FILE is a stored procedure that simply returns the file
contents as a BLOB.
|
| Would this work? What should the stored procedure look like? I'm sorry if
this question seems trivial but I couldn't find anything helpful on the web.
|
| Regards, Leo
Received on Fri Oct 26 2012 - 12:11:20 CEST

Original text of this message