orale11g建表遇到的ORA-12899错误

在创建表的时候遇到了下面的错误
SQL> create table bai_emp(emp_id number(6) not null, emp_name varchar2(30), first_letter varchar2(1) generated always as (upper(substr(trim(emp_name),1,1))) virtual) partition by list(first_letter)(partition part_1 values(‘A’,’B’), partition part_2 values(‘C’,’D’), partition part_3 values(‘E’,’F’));
create table bai_emp(emp_id number(6) not null, emp_name varchar2(30), first_letter varchar2(1) generated always as (upper(substr(trim(emp_name),1,1))) virtual) partition by list(first_letter)(partition part_1 values(‘A’,’B’), partition part_2 values(‘C’,’D’), partition part_3 values(‘E’,’F’))
*
ERROR at line 1:
ORA-12899: value too large for column “FIRST_LETTER” (actual: 1, maximum: 4)
查看NLS_LENGTH_SEMANTICS BYTE
设置的是byte,修改表的定义

create table bai_emp(emp_id number(6) not null, emp_name varchar2(30 char), first_letter varchar2(1 char) generated always as (upper(substr(trim(emp_name),1,1))) virtual) partition by list(first_letter)(partition part_1 values(‘A’,’B’), partition part_2 values(‘C’,’D’), partition part_3 values(‘E’,’F’));
正常

你可能感兴趣的:(oracle管理)