I am trying to read the contents of a text file that I uploaded using the page item file browser but I cannot figure out how to get the files contents.
I don't need it to be pushed into a table or anything, I just want a string represetation of it in a text area, for example. Or to be stored into a variable so I can process.
Apologies for the vagueness if any. I have tried a few ways but I am not sure, can I get the contents somehow using the WWV_FLOW_FILE?
The only solutions I have seen are using the Wizard region with the data mapping/verification breadcrumbs which is not what I need.
You can find the uploaded file as a BLOB inside the WWV_FLOW_FILE
. If you just want to show it, into lets say a text field named P1_some_text_field
, you can simple add a procedure like this on the page where you do the upload:
BEGIN
SELECT utl_raw.cast_to_varchar2(dbms_lob.substr(blob_content))
INTO :P1_some_text_field
FROM wwv_flow_files
WHERE created_on =
(SELECT MAX(created_on) FROM wwv_flow_files WHERE CREATED_BY = :APP_USER
);
END;
Please note that this will retrieve at most the fist 32767 characters of your file.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments