I need to store PDF files in my Oracle database using BFILES. I know that the file have to be present in database server file system, but all files are stored at some host in local network. My question is how to upload those files to database server using only PL/SQL. Is it possible?
-
You have a bunch of questions that have been answered and has obviously helped you, but you have not accepted them. Please do else people may be not be inclined to help you.Sathyajith Bhat– Sathyajith Bhat2012-01-10 04:48:11 +00:00Commented Jan 10, 2012 at 4:48
-
is the requirement to simply store the PDFs so Oracle can access them? Seems strange management would force your hand in specifying BFILE. Have you considered loading to LOB column in table with some additional identifiers/dates for selecting?tbone– tbone2012-01-11 14:18:54 +00:00Commented Jan 11, 2012 at 14:18
1 Answer
PL/SQL (unless we're talking about Oracle Forms) runs on the database server. So it can only access resources that are available on to the database server.
If the "host in local network" is a known file server, it should be possible for the database server to mount a directory that points to the directory on the file server where the files are stored. If that was done, your PL/SQL code could read the files from the file server and either copy them locally to the database server or just create a BFILE that references a file on the shared drive.
On the other hand, if you are saying that the files are stored on various client machines, you're almost certainly out of luck-- you would need some piece of code running on the client machine to send the file to the database server where it could be processed by the stored procedure.