Re: Opening external files
Date: 22 Apr 2002 11:34:48 -0700
Message-ID: <32fe19ad.0204221034.7943430e_at_posting.google.com>
"Carmine" <rto_at_libero.it> wrote in message news:<aa0pnc$itf$1_at_news.unina.it>...
> Hi NG
> ..how can i read external files using a command line inside an oracle
> procedure?
>
> example:
> i have a path stored in my DB table(c:\documents\ciccio.doc) and i want to
> open and read it by WinWord just executing an oracle procedure.
>
> ~Valentino
Oops, this sounds weired.
Some basic questions need to be clarified:
- What is your main application? Is it WinWord and you want to run some VBA to access the Oracle DB (with ADO/ODBC?) and then load the filename that you got from the database from the local hard drive into winword? Or do you have some Application, that communicates with the database and then launches WinWord (as OLE-Object) to display the file?
- Where is the path to be evaluated? On the client, if so on any/which client? Or on the server? If so, is WinWord installed on the same computer/server as the oracle db? If you open the file on the server how do you want to stream the data to the client, and how do you want to make WinWord to accept an "anonymous stream"? As far as I know it can only open files.
Yes, you can open files from within database procedures (with the util_file package:
hfile FILE_TYPE;
hfile = util_file('C:\path\on\the\db_server','filename.doc','W')
And yes, you can call external applications if they have a DLL/shared library like function call interface (For more detailed information look in the Oracle "PL/SQL User's Guide and Reference" (Chapter 10 External Procedures). But I don't see the use of it. Because the external procedure/application is run inside a database process and this process usually does not have a display attached to it.
So far, the only constellation that makes sense to is that the database stores
a filename including a path, that resides on a central fileserver and is
accessable by all clients. So some kind of Document-Content-Management
System if you prefer marketing words.
But even in that scenario I don't see where you would need a procedure.
A simple select of a VARCHAR-column of a table would do it, to get the
fully qualified filename as a string.
Not sure if this statements can help you...
Cheers, Rolf. Received on Mon Apr 22 2002 - 20:34:48 CEST
