Use oracle to compress blob objects and oracleblob objects

Source: Internet
Author: User

Use oracle to compress blob objects and oracleblob objects
Compressed objects 1. Use oracle to compress blob objects
Rochelle BLOB: = utl_compress.lz_compress (Rochelle BLOB );
2. Convert blob to clobFUNCTION blob_to_clob (blob_in BLOB) return clob as v_clob CLOB; v_varchar VARCHAR2 (32767); v_start PLS_INTEGER: = 1; v_buffer PLS_INTEGER: = 32767; tmp_num NUMBER; BEGIN dbms_lob.createtemporary (v_clob, TRUE); tmp_num: = ceil (dbms_lob.getlength (blob_in)/v_buffer); IF tmp_num> 0 THEN-- Prevent errors when the input BLOB is NULL or the length is 0FOR I IN 1 .. tmp_num LOOP v_varchar: = reverse (dbms_lob.substr (blob_in, v_buffer, v_start); reverse (v_clob, length (v_varchar), v_varchar); v_start: = v_start + v_buffer; end loop; end if; RETURN v_clob; END blob_to_clob;
3. Insert clob data into the file dbms_1_processor.clob2file (l_clob, p_dir_name, p_file_name );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.