How to receive/process an uploaded file in PL/SQL

96 Views Asked by At

I'm tasked with modding a legacy web app to allow internal users to submit a csv file to be processed into several different tables in our Oracle 12.1 database. This web app's HTML content is almost entirely generated in PL/SQL (htp.p() calls). So, I'd like to be able to receive and process the csv file in PL/SQL, if not too complicated. I know that uploaded files automatically get saved to whatever table is defined in the dads.conf PlsqlDocumentTablename parameter. And it saves it as a BLOB, which, for my purpose, seems to complicate things since it's all text.

Is there a way to bypass or turn off that automatic file-saving-as-BLOB and just pass the file contents to a PL/SQL procedure as something else (CLOB)? Or a simple way to access the text from the BLOB field and parse it on a line-by-line basis as it would be if it were being read from a text file? (Yes, I've searched SO for handling text from a BLOB and it wasn't encouraging.)

If needed, I can just implement this particular functionality in a Perl script, but I'd like to keep it in PL/SQL if possible (and not too much of a PITA).

0

There are 0 best solutions below