Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to load an image into a BLOB in VBA

Re: How to load an image into a BLOB in VBA

From: Dmitry <support_at_ispirer.com>
Date: Wed, 29 Jan 2003 11:47:34 +0200
Message-ID: <b187vn$100cai$1@ID-75577.news.dfncis.de>


Hi,

Using Excel with VBA is too long to load 10000 images to Oracle. I recommend you to use SQLLoader. It's simple and can quickly load 10000 images.
Firstly, create or generate a text file (tmp_img.txt e.g) containing:

1,1.jpg
2,2.jpg
3,3.jpg

....

Then create a SQLLoader control file (tmp_img.ctl) containing:

LOAD DATA
INFILE 'tmp_img.txt'
INTO TABLE TMP_IMG
INSERT
FIELDS TERMINATED BY ',' TRAILING NULLCOLS (EMPNUM,
 IMAGE_PIC_FILE FILLER,
 IMAGE_PIC LOBFILE (IMAGE_PIC_FILE) TERMINATED BY EOF') Then run SQLLoader as:

sqlldr userid=scott/tigger_at_ora control=tmp_img.ctl log=tmp_img.log

Best regards, Dmitry

--
SQLWays - Database migration software for IBM DB2, Oracle, SQL Server,
Sybase and MySQL
http://www.ispirer.com



"zorro" <z_at_z.com> wrote in message
news:SeBZ9.134770$Yo4.6414098_at_news1.calgary.shaw.ca...

> Hello,
>
> I would like to use Excel with a VBA script and OLE DB to load a list of
> images into Oracle 8.1.7.
>
> I have a table like this
>
> create table tmp_img (
> EMPNUM NUMBER(10) NOT NULL,
> IMAGE_PIC BLOB
> )
>
> and a 10,000 files on disk.
>
> 1.jpg
> 2.jpg
> etc...(until 10000.jpg)
>
> For each image, its filename is EMPNUM + '.jpg'
>
> How could I create a VBA procedure to read and insert these images into
> TMP_IMG ?
>
> Thank you,
>
> Denis
>
>
>
Received on Wed Jan 29 2003 - 03:47:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US