Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: BLOB data
Hi,
In addition to programming languages like C/C++/Java etc, you can use Oracle SQL Loader.
For example, for given table
CREATE TABLE blob1
(col1 VARCHAR2(100),
col2 BLOB);
create a text file, containing
image1 name, image1.jpg image2 name, image2.jpg image3 name, image3.jpg image4 name, image4.jpg
Specify real image files instead of imageN.jpg and fill other columns.
Then create a control file for SQL Loader:
LOAD DATA
INFILE 'blob1.txt'
INTO TABLE BLOB1
INSERT
FIELDS TERMINATED BY ',' TRAILING NULLCOLS
(COL1 OPTIONALLY ENCLOSED BY '"',
COL2_FILE FILLER OPTIONALLY ENCLOSED BY '"',
COL2 LOBFILE (COL2_FILE) TERMINATED BY EOF NULLIF COL2_FILE='')
Then run SQL Loader:
sqlldr userid=usr/usr control=blob1.ctl log=blob1.log
It will load your images to an Oracle database
Best regards, Dmitry
-- http://www.ispirer.com/products - Database migration tool for Oracle, DB2, MS SQL Server, Sybase and MySQL. "Butt, Naseem [CAR:7622:EXCH]" <nbutt_at_americasm01.nt.com> wrote in message news:ar0pj9$60q$1_at_bcarh8ab.ca.nortel.com...Received on Sat Nov 16 2002 - 09:36:55 CST
> Can someone help me to understand how ti import images into an Oracle
table.
> I have created the table using the BLOB datatype to store the
images....need
> o understand the SQL code to import the data ?
>
> Thanks,
>
> Naseem
>
>