Home » RDBMS Server » Server Utilities » load jpg picture into oracle database (windows 7 64bit, oracle 10.2)
load jpg picture into oracle database [message #510920] Wed, 08 June 2011 06:14 Go to next message
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 #510926 is a reply to message #510920] Wed, 08 June 2011 06:29 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
file_id INTEGER(5),
...
file_id LOBFILE (file_name)


It is indeed several times.
You cannot have 2 columns with the same name.
The second one is file_data.

Regards
Michel

[Updated on: Wed, 08 June 2011 06:30]

Report message to a moderator

Re: load jpg picture into oracle database [message #510933 is a reply to message #510926] Wed, 08 June 2011 07:16 Go to previous messageGo to next message
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 #510934 is a reply to message #510933] Wed, 08 June 2011 07:20 Go to previous messageGo to next message
cookiemonster
Messages: 13961
Registered: September 2008
Location: Rainy Manchester
Senior Member
That would be because you are running sqlloader as system rather than anna.
Re: load jpg picture into oracle database [message #510985 is a reply to message #510934] Wed, 08 June 2011 18:31 Go to previous message
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
Previous Topic: DMP from 11G to 10G
Next Topic: Export Utility
Goto Forum:
  


Current Time: Mon Dec 23 11:15:46 CST 2024