Relationship between character sets and sorting commands in Oracle databases

Source: Internet
Author: User

The following articles mainly introduce the actual commands related to character sets and sorting in Oracle databases. We have specially sorted out the following articles for this purpose. I believe they will be used in future studies. First, we will introduce the main content of the article caused by Java code.

Java code

 
 
  1. SQL> select * from v$nls_valid_values where parameter='CHARACTERSET' order by 2;  
  2. PARAMETER VALUE  
  3. CHARACTERSET AL16UTF16  
  4. CHARACTERSET AL24UTFFSS  
  5. CHARACTERSET AL32UTF8  
  6. SQL> select * from nls_database_parameters;  
  7. PARAMETER VALUE  

NLS_LANGUAGE AMERICAN -- legal language name

NLS_TERRITORY AMERICA -- valid region name

 
 
  1. NLS_CURRENCY $  
  2. NLS_ISO_CURRENCY AMERICA  
  3. NLS_NUMERIC_CHARACTERS .,  

NLS_CHARACTERSET ZHS16GBK -- database Character Set

NLS_CALENDAR GREGORIAN

NLS_DATE_FORMAT DD-MON-RR -- Date Format

 
 
  1. NLS_DATE_LANGUAGE AMERICAN 

Oracle Data Character Set and sorting; NLS_SORT BINARY -- sorting method

 
 
  1. NLS_TIME_FORMAT HH.MI.SSXFF AM  
  2. NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM  
  3. NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR  
  4. NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR  
  5. NLS_DUAL_CURRENCY $  

NLS_COMP BINARY -- sorting-related stuff. What is unclear?

 
 
  1. NLS_LENGTH_SEMANTICS BYTE  
  2. NLS_NCHAR_CONV_EXCP FALSE  

NLS_NCHAR_CHARACTERSET AL16UTF16 -- National Character Set

 
 
  1. NLS_RDBMS_VERSION 10.1.0.2.0 

You have selected 20 rows.

Used time: 00: 00: 00.03

 
 
  1. SQL> create table char_t(c1 varchar2(8),c2 nvarchar2(8)); 

The table has been created.

Oracle Data Character Set and sorting: used time: 00: 00: 00.2

 
 
  1. SQL> select dbms_metadata.get_ddl('TABLE','CHAR_T') FROM DUAL;  
  2. DBMS_METADATA.GET_DDL('TABLE','CHAR_T')  
  3. CREATE TABLE "SCOTT"."CHAR_T"  
  4. ( "C1" VARCHAR2(8),  
  5. "C2" NVARCHAR2(8)  
  6. ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING  
  7. STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645  
  8. PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)  
  9. TABLESPACE "USERS"  

Used time: 00: 00: 05.15

 
 
  1. SQL> INSERT INTO char_t values('a','a'); 

One row has been created.

Used time: 00: 00: 00.01

 
 
  1. SQL> commit; 

Submitted.

Used time: 00: 00: 00.00

 
 
  1. SQL> select length(c1),length(c2),lengthb(c1),lengthb(c2) from char_t;  
  2. LENGTH(C1) LENGTH(C2) LENGTHB(C1) LENGTHB(C2)  
  3. 1 1 1 2  

Used time: 00: 00: 00.00

 
 
  1. SQL> insert into char_t values ('medium', 'medium ');

One row has been created.

Used time: 00: 00: 00.00

The above content describes the Oracle Data Character Set and sorting, hoping to help you in this regard.

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.