Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload Document to Local Directory

Status
Not open for further replies.

cecilcheah

Programmer
Apr 30, 2001
28
CH
Hi there

In my Application, i need to display a Word Document inside a Office Framer Control.

The Document is stored in a Table in Oracle. I am able to retrieve it with utl_file.put_raw. The document is now saved in the Directory in the Oracle Server. How can i display the document in my application? The user does not have access to this directory in the oracle server. I need to be able to give the path where the document is to let the Office Framer Control to open the Word Document. Thanks in advance
 
Er, well, to cut a long story short, you don't!

The way you're attempting to go about this is fundamentally wrong. One of the great benefits of a database is that you can establish a connection to it from application software, and then, as if by magic, over your network, it can deliver data.

Taking the data out of Oracle and putting it on the server is bad news indeed. Once it's a file on the server, nobody can see it (as you have just found out). Phew, thank goodness your server administrators have the good sense not to let anyone and everybody do whatever they like. Oh, did I forget to mention that you'll soon run out of storage on the server, what with someone perpetually dumping word documents to it.

The answer is that you establish a connection from your application to the db in question, and retrieve the document as a BLOB for example (look that up in the docs) and then display said BLOB to the user. You could even go completely mad and put the word document onto the user's machine, and let them edit the word document using, wait for it...... word.

Regards

T
 
Thanks for the answer. I was always for a week because of family funeral.
Can you show me how to retrieve a BLOB and save it as file for user to edit?
 
Unfortunately, no I can't.

I'm not being awkward, but Oracle's scripting language called SQL PLUS doesn't acquire the ability to directly load BLOB's until version 11, and this is a version 10 forum - sorry.

Your application developers must be using some sort of connection technology which will support this, be it JDBC, ODBC, ADO or whatever. They should write their application to fetch the BLOB to the client, and then either edit it within the application, or make it available locally on the client for editing, presumably in word itself. Note that it will be up to the application developers to handle concurrency issues (i.e. 2 or more user simultaneously editing a copy of the document) etc.

What technology are you intending to use? Maybe one of the other forums might be able to help.

Regards

T
 
I would have thought you'd be able to do it using PL/SQL and DBMS_LOB.
 
Thanks for pointing that out Dagon - I'd gotten so tied up with thinking about connections that I forgot the obvious - sigh.

Regards

T
 
Thanks for helping.

So i can write a Function or Package with PL/SQL. My application will call this function, fetch the BLOB and then write a word file in the user computer. Then the Office Framer Control will be able to open this document to let my user to edit it.

Is this correct? If so, how does a function stream a file in the user computer, since the user computer is remote from the point of the Oracle Server. This is my problem, or maybe my concept is wrong.

Consider it like a web application. How can this be done? I have fetched the BLOB, how can i convert the BLOB to DOC?

Thanks again in advance
 
cecil,

as a DBA, I am slightly out of my depth here.
The application developers should be able to take the blob provided by oracle and save it locally.

The tool you then use to edit the file is of course beyond my ken. HOwever, even if you just use word, that should be fine. If there is a business reason why you have to edit a word document in something other than word, then the developers have to take that into account.

I am at the end of my knowledge here. Can anyone else help?

Regards

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top