尝试创建范围分区时出现 ORA-00926
ORA-00926 when trying to create a Range Partition
SQL> create table contracts_range (
2 document_no integer not null,
3 contract_date date,
4 start_date date,
5 end_date date,
6 salary float)
7 partition by range (contract_date)
8 (
9 partition contracts_jan2020 VALUE LESS THAN ('2020-01-31'),
10 partition contracts_fen2020 VALUE LESS THAN ('2020-03-01'),
11 partition contracts_mar2020 VALUE LESS THAN ('2020-03-31'));
第 9 行出现错误:
ORA-00926: 缺少 VALUES 关键字
是"values less than",复数形式,不是"value less than":
create table contracts_range (
document_no integer not null,
contract_date date,
start_date date,
end_date date,
salary float)
partition by range (contract_date)
(
partition contracts_jan2020 VALUES LESS THAN ('2020-01-31'),
-- Here -------------------------^
partition contracts_fen2020 VALUES LESS THAN ('2020-03-01'),
-- Here -------------------------^
partition contracts_mar2020 VALUES LESS THAN ('2020-03-31')
-- Here -------------------------^
);
SQL> create table contracts_range (
2 document_no integer not null,
3 contract_date date,
4 start_date date,
5 end_date date,
6 salary float)
7 partition by range (contract_date)
8 (
9 partition contracts_jan2020 VALUE LESS THAN ('2020-01-31'),
10 partition contracts_fen2020 VALUE LESS THAN ('2020-03-01'),
11 partition contracts_mar2020 VALUE LESS THAN ('2020-03-31'));
第 9 行出现错误: ORA-00926: 缺少 VALUES 关键字
是"values less than",复数形式,不是"value less than":
create table contracts_range (
document_no integer not null,
contract_date date,
start_date date,
end_date date,
salary float)
partition by range (contract_date)
(
partition contracts_jan2020 VALUES LESS THAN ('2020-01-31'),
-- Here -------------------------^
partition contracts_fen2020 VALUES LESS THAN ('2020-03-01'),
-- Here -------------------------^
partition contracts_mar2020 VALUES LESS THAN ('2020-03-31')
-- Here -------------------------^
);