load jpg picture into oracle database [message #510920] |
Wed, 08 June 2011 06:14 |
|
x-oracle
Messages: 380 Registered: April 2011 Location: gujarat
|
Senior Member |
|
|
hello i want to load jpg into my oracle database 10g
throw sqlloader
i did folloing steps
step 1)
Create the table as follows
CREATE TABLE image_table (file_id NUMBER(5),
file_name VARCHAR2(30),file_data BLOB);
step 2 )
Create control file as follows
LOAD DATA
INFILE *
INTO TABLE image_table
REPLACE
FIELDS TERMINATED BY ','
(
file_id INTEGER(5),
file_name CHAR(30),
file_id LOBFILE (file_name)
TERMINATED BY EOF
)
BEGINDATA
1,F:\Koala.jpg
step 3)
Then i have run this command
F:\oracle\product\10.2.0\db_1\bin>sqlldr control=F:\practice\control.ctl
Username:system
Password
so i got this error
SQL*Loader: Release 10.2.0.5.0 - Production on Wed Jun 8 13:47:27 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL*Loader-404: Column FILE_ID present more than once in IMAGE_TABLE's INTO TABL
E block.
|
|
|
|
Re: load jpg picture into oracle database [message #510933 is a reply to message #510926] |
Wed, 08 June 2011 07:16 |
|
x-oracle
Messages: 380 Registered: April 2011 Location: gujarat
|
Senior Member |
|
|
ok now my controlfile is as follow
LOAD DATA
INFILE *
INTO TABLE image_table
REPLACE
FIELDS TERMINATED BY ','
(
file_id INTEGER(5),
file_name CHAR(30),
file_data LOBFILE (file_name)
TERMINATED BY EOF
)
BEGINDATA
1,F:\Koala.jpg
step 2)
now when i run this command
F:\oracle\product\10.2.0\db_1\bin>sqlldr system/oracle@orcl
control = F:\practice\control.ctl
i got this follwing error
SQL*Loader-941: Error during describe of table IMAGE_TABLE
ORA-04043: object IMAGE_TABLE does not exist
but already this image_table in my oracle
look this
SQL> conn anna/anna
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DATES TABLE
TEST TABLE
DM1 TABLE
DD1 TABLE
HELLO_WORLD TABLE
T1 TABLE
IMAGE_TABLE TABLE
7 rows selected.
SQL> desc image_table
Name Null? Type
----------------------------------------- -------- ----------------------------
FILE_ID NUMBER(5)
FILE_NAME VARCHAR2(30)
FILE_DATA BLOB
-
Attachment: ora.pdf
(Size: 331.06KB, Downloaded 2365 times)
[Updated on: Wed, 08 June 2011 07:28] Report message to a moderator
|
|
|
|
Re: load jpg picture into oracle database [message #510985 is a reply to message #510934] |
Wed, 08 June 2011 18:31 |
|
Barbara Boehmer
Messages: 9101 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Please see the corrected control file below.
LOAD DATA
INFILE *
INTO TABLE anna.image_table
REPLACE
FIELDS TERMINATED BY ','
(
file_id INTEGER EXTERNAL(5),
file_name CHAR(30),
file_data LOBFILE (file_name)
TERMINATED BY EOF
)
BEGINDATA
1,F:\Koala.jpg
|
|
|