I am writing one pl/sql logic to insert data from csv file to databse table. Since I have to do some pre processing steps I am using the custom logic instead of the standard data load feature.
My Apex Version is 4.1.0.00.32.
Earlier in Apex 4.0 for finding the latest file uploaded by a user, I was using the below peace of code.
select blob_content into v_blob_data from wwv_flow_files
where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USER)
and id = (select max(id) from wwv_flow_files where updated_by = :APP_USER);
But in APEX 4.1, the WHO columns(created_by,updated_by etc) are not populating. So I am not able to use the above logic to extract the latest file.
Do anyone have a workaround for this.!!
I have managed to insert the data by defaulting the file name. But after inserting all the records the page is loading for a long time and the page is getting time out. Is there any solution for this.?
if you're using the filebrowse in apex, you can do something like this to get the file from the table.
SELECT id,filename, mime_type, blob_content,name FROM apex_application_files
WHERE name = p_filename;
p_filename would be the value returned from the filebrowse item. The name that comes out is unique and will look something like x99999999/filename.csv, the actual file name will be stored in the filename column.