Home » SQL & PL/SQL » SQL & PL/SQL » insert pdf & image in oracle database using sql command line syntax
insert pdf & image in oracle database using sql command line syntax [message #246218] Wed, 20 June 2007 05:43 Go to next message
sbmk_design
Messages: 88
Registered: April 2007
Location: CHENNAI
Member
Hi
I wanted to insert a pdf (or) picture document in my table,I tried with the following syntax.what data type I should use.

SQL> CREATE TABLE TEST(TNO NUMBER,PHOTO BLOB);
Table created.

SQL> INSERT INTO TEST VALUES(1,'C:\image24[4]');

SQL> INSERT INTO TEST VALUES(1,'C:\image24[4].JPGE');

ERROR at line 1:
ORA-01465: invalid hex number

by
sbmk_design

Re: insert pdf & image in oracle database using sql command line syntax [message #246220 is a reply to message #246218] Wed, 20 June 2007 05:54 Go to previous messageGo to next message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to use PL/SQL to load your images.
Have a look at DBMS_LOB.LOADBLOBFROMFILE function.

Remember Oracle can only load what is on the SERVER and not on the CLIENT.

Regards
Michel
Re: insert pdf & image in oracle database using sql command line syntax [message #246248 is a reply to message #246220] Wed, 20 June 2007 07:28 Go to previous messageGo to next message
sbmk_design
Messages: 88
Registered: April 2007
Location: CHENNAI
Member
Thanks Mr.Michel
Can I have a real time example( i.e plsql syntax)

by
sbmk_design
Re: insert pdf & image in oracle database using sql command line syntax [message #246258 is a reply to message #246248] Wed, 20 June 2007 08:02 Go to previous message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Search is a great thing.
http://www.oracle.com/pls/db102/print_hit_summary?search_string=LOADBLOBFROMFILE gives you:
Database Application Developer's Guide - Large Objects, Chapter 14 LOB APIs for Basic Operations and so on.
They are examples.
Explore, you'll find many interesting things.

Regards
Michel
Previous Topic: Where Clause from table
Next Topic: CrossTab
Goto Forum:
  


Current Time: Tue Dec 06 08:51:09 CST 2016

Total time taken to generate the page: 0.06566 seconds