Oracle PL/SQL library BLOB_WRAPPER: Read content from a file into a blob

This is an example on how BLOB_WRAPPER can be used to read the content of a file into a blob. (blob_wrapper.from_file).
The file that was created with this script is read into a blob.
declare
  b blob;
begin
  b := blob_wrapper.from_file('LOB_TEST_DIR', 'circle.txt');

  if dbms_lob.getlength(b) != 161202 then
     dbms_output.put_line('Expected size of circle.txt is 161202');
  end if;
  blob_wrapper.to_file('LOB_TEST_DIR', 'circle_new.txt', b);
end;
/
The source code for this exaple is on github.
Go back to library's main page