Home » SQL & PL/SQL » SQL & PL/SQL » How to store the zip file in oracle table ? (Oracle 10 g)
How to store the zip file in oracle table ? [message #361611] Thu, 27 November 2008 03:20 Go to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
Hi,

Can any one help me how to store the zip file in oracle table ?


Thanks in Advance
Re: How to store the zip file in oracle table ? [message #361614 is a reply to message #361611] Thu, 27 November 2008 03:23 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Store it in a BLOB
Re: How to store the zip file in oracle table ? [message #361631 is a reply to message #361614] Thu, 27 November 2008 03:51 Go to previous messageGo to next message
rangan.s
Messages: 75
Registered: February 2008
Location: chennai
Member
SQL> DESC BLOB_TABLE;
Name Type    Nullable Default Comments 
---- ------- -------- ------- -------- 
A    INTEGER Y                         
B    BLOB    Y        

SQL> INSERT INTO BLOB_TABLE VALUES(5,BLOB('MWDIR_TST','TEST.ZIP'));

INSERT INTO BLOB_TABLE VALUES(5,BLOB('MWDIR_TST','TEST.ZIP'))

ORA-00904: "BLOB": invalid identifier

SQL> INSERT INTO BLOB_TABLE VALUES(5,('MWDIR_TST','TEST.ZIP'));

INSERT INTO BLOB_TABLE VALUES(5,('MWDIR_TST','TEST.ZIP'))

ORA-00907: missing right parenthesis

SQL> INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'));

INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'))

ORA-01465: invalid hex number

SQL> INSERT INTO BLOB_TABLE VALUES(5,('\\MWDIR_TST\TEST.ZIP'));
Re: How to store the zip file in oracle table ? [message #361633 is a reply to message #361631] Thu, 27 November 2008 03:55 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
LOB APIs for Basic Operations
Re: How to store the zip file in oracle table ? [message #361645 is a reply to message #361633] Thu, 27 November 2008 04:28 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I think you should not post a link to OP, you should let him try all the syntaxes he can imagine, maybe one day, in the next century, he will in the end find a working one. Razz

Regards
Michel
Re: How to store the zip file in oracle table ? [message #361659 is a reply to message #361645] Thu, 27 November 2008 05:13 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Maybe some Oracle developer sees the syntax he posted, and thinks "Hey, that's a good idea" and implements that syntax in Version 20.X in the next century. Very Happy
Re: How to store the zip file in oracle table ? [message #361663 is a reply to message #361659] Thu, 27 November 2008 06:10 Go to previous messageGo to next message
mamalik
Messages: 266
Registered: November 2008
Location: Pakistan
Senior Member

Dear All.

We should not joke this may heart . If God has bestowed you knowledge then deliver it. By doing it God will deliver you many more.

Regards.
Asif.
Re: How to store the zip file in oracle table ? [message #361669 is a reply to message #361663] Thu, 27 November 2008 06:33 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://download.oracle.com/docs/cd/B19306_01/text.102/b14218/astopsup.htm#sthref2551:

./fa/5367/0/

Regards
Michel
  • Attachment: Stop.JPG
    (Size: 14.75KB, Downloaded 1373 times)
Re: How to store the zip file in oracle table ? [message #361671 is a reply to message #361663] Thu, 27 November 2008 06:39 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Please refrain from bringing religion into this forum in any way shape or form. It is not welcome.
Re: How to store the zip file in oracle table ? [message #361688 is a reply to message #361663] Thu, 27 November 2008 08:37 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Theology notwithstanding, the most straightforwards way to do it from Pl/Sql is this:

1) Create a Directoyr that points to the physical directory holding the Zip file
2) Create a Bfile locator that points to the zip file
3) Use Dbms_Lob.loadfromfile to load the dats from this Bfile into the BLOB.

here's an example
Previous Topic: SQL for getting list of active accounts
Next Topic: concat two columns
Goto Forum:
  


Current Time: Wed Dec 07 05:04:07 CST 2016

Total time taken to generate the page: 0.15226 seconds