Home » SQL & PL/SQL » SQL & PL/SQL » download a pdf file from long raw
download a pdf file from long raw [message #230762] Thu, 12 April 2007 13:59 Go to next message
thorin666
Messages: 144
Registered: March 2007
Senior Member

Hi, i have a table with a file in long raw format, inside i have a lot of pdf's but i must to download them from the database to my hard disk drive.
i tried to search for the import/export utility (exp) but export the table data to dmp a file.
and with the sqlldr only upload (or maybe i am wrong)

please help MEEEEEEEEEEeeeeeeeeeeeee.......... Wink
Re: download a pdf file from long raw [message #230828 is a reply to message #230762] Fri, 13 April 2007 00:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to write a program in your favorite language (C, Java, ...) to do that.

Regards
Michel
Re: download a pdf file from long raw [message #230842 is a reply to message #230828] Fri, 13 April 2007 01:24 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Why don't you store them on the server first (through UTL_FILE) and move them to the client afterwards?

MHE
Re: download a pdf file from long raw [message #230846 is a reply to message #230842] Fri, 13 April 2007 01:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
utl_file works only on characters and not binary data (long raw).
Moreover lines are limited to 255 characters (32K-1 in 10g).

Regards
Michel
Re: download a pdf file from long raw [message #230853 is a reply to message #230846] Fri, 13 April 2007 02:08 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Michel Cadot wrote on Fri, 13 April 2007 08:58
utl_file works only on characters and not binary data (long raw).
Moreover lines are limited to 255 characters (32K-1 in 10g).

Regards
Michel

Michel, are you sure? It was my understanding that UTL_FILE could read/write binary data as of Oracle 9iR2. Just a minute...I'll check.

MHE
Re: download a pdf file from long raw [message #230861 is a reply to message #230846] Fri, 13 April 2007 02:15 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
...it seems I was right:

Oracle9i Application Developer's Guide - Fundamentals Release 2 (9.2)
The UTL_FILE package has a number of new functions for performing popular file operations. You can seek, auto-flush, read and write binary data, delete files, change file permissions, and more. You should begin using the CREATE DIRECTORY statement (using double quotation marks around any lowercase names), rather than the UTL_FILE_DIR initialization parameter.


UTL_FILE.PUT_RAW

MHE
Re: download a pdf file from long raw [message #230865 is a reply to message #230853] Fri, 13 April 2007 02:29 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From PL/SQL Packages and Types Reference, first line on UTL_FILE:
Quote:
With the UTL_FILE package, PL/SQL programs can read and write operating system text files.

(emphasis is mine).

Regards
Michel
Re: download a pdf file from long raw [message #230866 is a reply to message #230861] Fri, 13 April 2007 02:33 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Ah ah! Once more documentation is contradictory.

But there is a limit of 32K on data.
If PDF file (long raw column) is larger, he still has to write his own program.

Regards
Michel
Re: download a pdf file from long raw [message #230872 is a reply to message #230866] Fri, 13 April 2007 02:43 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Michel, I believe that's a flaw in the documentation.
Look at TKyte's first comment here. This thread also discusses the same issue.

I came across this 32K limit thing somewhere along the lines, but it's up to the OP to visit Tom's website and search for himself Wink

MHE
Re: download a pdf file from long raw [message #230881 is a reply to message #230872] Fri, 13 April 2007 03:45 Go to previous message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yeap! Cool

Michel
Previous Topic: how to print xmlgen result
Next Topic: Validate CSV before Staging Table
Goto Forum:
  


Current Time: Wed Dec 07 05:03:34 CST 2016

Total time taken to generate the page: 0.12541 seconds