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

From: <>
Date: Fri, 26 Oct 2012 01:47:03 -0700 (PDT)
Message-ID: <>

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 - 10:47:03 CEST

Original text of this message