Oracle PL/SQL/Data Type/National Char

Материал из SQL эксперт
Перейти к: навигация, поиск

Create table: a national char column

SQL>
SQL> create table foo (
  2         a   integer,
  3         b   dec( 9, 2 ),
  4         c   character varying( 30 ),
  5         d   national char( 3 )
  6  );
Table created.
SQL>
SQL>
SQL> desc foo;
 Name                                                                                                  Null?    Type
 ----------------------------------------------------------------------------------------------------- -------- ----------
 A                                                                                                      NUMBER(38)
 B                                                                                                      NUMBER(9,2)
 C                                                                                                      VARCHAR2(30)
 D                                                                                                      NCHAR(3)
SQL>
SQL> drop table foo;
Table dropped.
SQL>



Use national char set

SQL>
SQL>
SQL> create table foo (
  2        a   integer,
  3        b   dec( 9, 2 ),
  4        c   character varying( 30 ),
  5        d   national char( 3 )
  6      )
  7      /
Table created.
SQL> describe foo
 Name                     Null?    Type
 ------------------------ -------- --------------------------------------------------------------------
 A                         NUMBER(38)
 B                         NUMBER(9,2)
 C                         VARCHAR2(30)
 D                         NCHAR(3)
SQL>
SQL> drop table foo;