In my apex application, the user selects a file in file_upload item.
I am on Oracle APEX 24.29 if that matters.
Then when they click Submit I call the process task and one step is to do the validation of what was uploaded, as it is an xls file.
This is my entire PL/SQL function.
I don't see where I would be doing a conversion to a number.
If I do:
SELECT line_number, …
INTO line_number, …
I get the same error, so I took it out.
The ultimate goal is to loop over all the rows, except for the first one, and validate certain cells in each row, but I want it to not be throwing an error just doing this part.
If someone can help me understand how I can loop over each row that would be great, but right now it is just doing the header, which is all strings.
DECLARE
l_file_id NUMBER := :P2_FILE_UPLOAD;
col1 VARCHAR(200);
col2 VARCHAR(200);
col3 VARCHAR(200);
line_number INT;
l_blob BLOB;
TYPE t_file_rec IS RECORD (
filename_part_2 VARCHAR2(1000),
file_item_id VARCHAR2(1000)
);
TYPE t_file_tab IS TABLE OF t_file_rec;
l_files t_file_tab := t_file_tab(
t_file_rec('Pumping_Test.pdf', 'P2_FILE_UPLOAD')
);
BEGIN
SELECT blob_content
INTO l_blob
FROM apex_application_temp_files
WHERE ROWNUM = 1;
SELECT col001,col002,col003
INTO col1, col2, col3
FROM TABLE(APEX_DATA_PARSER.PARSE
(p_content => l_blob,
p_file_name => 'test.xls'));
END;