Home » SQL & PL/SQL » SQL & PL/SQL » Inserting BLOB (image file) in database through SQL Query (Oracle 9i)
Inserting BLOB (image file) in database through SQL Query [message #297273] Wed, 30 January 2008 23:32 Go to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Friends,

I need to insert one jpg file in orace database.
Can we insert through the single SQL Query?
i tried like this,

create table img(img1 blob);

insert into img values(read_image_file('D:\pic1.jpg'));

Error is:

ERROR at line 3:
ORA-06550: line 3, column 24:
PL/SQL: ORA-00904: "READ_IMAGE_FILE": invalid identifier
ORA-06550: line 3, column 1:
PL/SQL: SQL Statement ignored


Regards

Manoharan
Re: Inserting BLOB (image file) in database through SQL Query [message #297275 is a reply to message #297273] Wed, 30 January 2008 23:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
dbms_lob.loadblobfromfile

Regards
Michel
Re: Inserting BLOB (image file) in database through SQL Query [message #297336 is a reply to message #297273] Thu, 31 January 2008 03:07 Go to previous messageGo to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Dear Michel,

I tried from your URL. I used
dbms_loadlobfromfile method also.
still invalid identifier error is coming...

I hope it BLOB methods working only in 9i right?

Sorry i already mentioned 9i in subject but

Database version is : 8.0.6.0.0

Is it possible in 8i?

Thanks

Mano
Re: Inserting BLOB (image file) in database through SQL Query [message #297347 is a reply to message #297336] Thu, 31 January 2008 03:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
8.0.6 is not 8i which is 8.1.*


All documentation is on http://tahiti.oracle.com
If it existed in this version I think it was then called dbms_lob.loadfromfile.

Just try desc dbms_lob or select on dba_objects...

Regards
Michel


Re: Inserting BLOB (image file) in database through SQL Query [message #297361 is a reply to message #297273] Thu, 31 January 2008 04:17 Go to previous messageGo to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Dear Michel,

Yes, many procedures are coming. Through the forms 6i i can able to load and get the images.. but i need from direct query itself.. Can you give one simple query?.

Thanks
Mano



Re: Inserting BLOB (image file) in database through SQL Query [message #297362 is a reply to message #297273] Thu, 31 January 2008 04:17 Go to previous messageGo to next message
spmano1983
Messages: 269
Registered: September 2007
Senior Member
Sorry for wrong post...

Dear Michel,

Yes, many procedures are coming. Through the
forms 6i i can able to load and get
the images.. but i need
from direct query itself..
Can you give one simple query?.

Thanks
Mano


Re: Inserting BLOB (image file) in database through SQL Query [message #297367 is a reply to message #297362] Thu, 31 January 2008 04:32 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Can you give one simple query?

Can you search in the documentation for what I said?

Regards
Michel

Previous Topic: to_char function
Next Topic: date difference excluding weekends on a simple table!
Goto Forum:
  


Current Time: Sun Dec 04 22:33:33 CST 2016

Total time taken to generate the page: 0.12374 seconds