Search code examples
oracle-apexoracle-apex-5oracle-apex-5.1oracle-apex-19.1

wwv_flow_files no longer available to use its fields in Apex19.1


We are migrating applications from Apex4.2 to Apex19.1 and used Temp table (wwv_flow_files) in our one page to upload spreadsheet and then perform PLSQL process on the page. But as wwv_flow_files is now deprecated and we have to use APEX_APPLICATION_TEMP_FILES temp table but unfortunately the fields that we used don't exit in new Temp table in Apex19.1

select blob_content into v_blob_data from wwv_flow_files where last_updated = (select max(last_updated) from wwv_flow_files where upper(UPDATED_BY) = upper(:APP_USER)) and id = (select max(id) from wwv_flow_files where upper(updated_by) = upper(:APP_USER));

Little brief about PLSQL process: Above PLSQL is part of one block where Spreadsheet will be uploaded and then on multiple validations it gets values into Physical table of Oracle.

We are performing migration and have to make sure will minimal effort functionality should work as is.

Please help. Thanks in advance.


Solution

  • In the where clause you only need the column "name" from apex_application_temp_files!

    https://docs.oracle.com/cd/E11882_01/appdev.112/e11945/up_dn_files.htm#CIHDDJGF

    Example:

      IF ( :P1_FILE_NAME is not null ) THEN 
         INSERT INTO oehr_file_subject(id,NAME, SUBJECT, BLOB_CONTENT, MIME_TYPE) 
          SELECT ID,:P1_FILE_NAME,:P1_SUBJECT,blob_content,mime_type
                FROM APEX_APPLICATION_TEMP_FILES
                WHERE name = :P1_FILE_NAME;
      END IF;