Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Read blob file from oracle apex wwv_flow_files

3705168May 9 2018 — edited Jun 1 2018

I uploaded excel file with special characters. When I am reading the blob file from apex wwv_flow_files.Special characters are ignored.I tried with below code.

DECLARE  

  v_blob       BLOB;

  v_start      NUMBER         := 1;

  v_bytelen    NUMBER         := 2000;

  v_len        NUMBER;

  v_raw        RAW (2000);

  v_x          NUMBER;

  v_sql_text    VARCHAR2(32767):= NULL;

  v_data_array        wwv_flow_global.vc_arr2;

  v_sr_no             number:= 1;

BEGIN

     SELECT DBMS_LOB.getlength (blob_content)

       INTO v_len

      from wwv_flow_files where NAME='F1364968530/TEST_EXCEL.CSV';

      -- save blob length

      v_x := v_len;

      -- select blob into variable

      SELECT blob_content

       INTO v_blob

      from wwv_flow_files

where NAME='F1364968530/TEST_EXCEL.CSV';

     v_start := 1;

     WHILE v_start < v_len AND v_bytelen > 0

     LOOP

        DBMS_LOB.READ (v_blob, v_bytelen, v_start, v_raw);

        v_sql_text := UTL_RAW.cast_to_varchar2 (v_raw);

         -- set the start position for the next cut

         v_start := v_start + v_bytelen;

         -- set the end position if less than 2000 bytes

         v_x := v_x - v_bytelen;

htp.prn(v_sql_text);

     END LOOP;

    

END;

How to Read the special characters from blob.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 6 2018
Added on May 9 2018
3 comments
797 views