Code Listing 3: Using character semantics
SQL> DECLARE
  2     --Allow for three UTF-8 characters,

  3     --which can each be three-bytes in size
  4     x CHAR(3 CHAR);
  5  BEGIN
  6     --x can hold three single-byte UTF-8 characters
  7     x := 'aaa';

  8     DBMS_OUTPUT.PUT_LINE(LENGTH(x));
  9  
 10     --And x can hold only three two-byte UTF-8 characters
 11     x := 'ããã';
 12     DBMS_OUTPUT.PUT_LINE(LENGTH(x));
 13  END;

 14  /
3
3

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