Code Listing 2: Using byte semantics
SQL> DECLARE
  2     --Allow for three UTF-8 characters,
  3     --which can each be three-bytes in size
  4     x CHAR(9 BYTE);
  5  BEGIN

  6     --x can hold nine single-byte UTF-8 characters
  7     x := 'aaaaaaaaa';
  8     DBMS_OUTPUT.PUT_LINE(LENGTH(x));
  9  
 10     --However, x can hold only four two-byte UTF-8 characters
 11     x := 'ãããã';

 12     DBMS_OUTPUT.PUT_LINE(LENGTH(x));
 13  END;
 14  /
9
5
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy