Data read __oracle for CLOB field types in Oracle 11g

Source: Internet
Author: User
 
Pl/sql Procedure: Data reading of Clob field types in Oracle 11g 
the database column of the LOB type stores only the locator, which points to the storage location of the large object. 
manipulate LOB data with the Dbms_lob package. When reading data with an Oracle field type of CLOB column, only part of the following figure can be read: a 
full read of the data Pl/sql procedure for an Oracle field type of CLOB column 
: 
 
DECLARE
  /* Declaration Pl/sql in the program block in the variable Info_var, the user holds the query to the Info column of the data, its type must be the same as the field type in the table/
  info_var     clob;
  --Query data length
  amount       integer; 
  --Offset, query start position
  offset       integer;
  --The byte to be printed, the storage variable
  info_output  varchar2 (1000);
Begin
  --queries the field information to be printed and assigns it to Info_var
  Select info into Info_var from T_clob where id = 1;
  --Inquiry 100 length
  amount: =100;
  --From the first start
  offset: =1;
  --Using DBMS_LOB package to read Data
  dbms_lob.read (Info_var,amount,offset,info_var);
  --print read and obtain data with Dbms_lob package Info_var
  dbms_output.put_line (info_var);
End;
/

command: SET serveroutput on window display data


Related Article

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.