How to insert data in partition table which is not defined in partition?
17,095
you will get a ORA-14400 error:
SQL> CREATE TABLE t (ID NUMBER)
2 PARTITION BY RANGE (ID)
3 ( PARTITION t1 VALUES LESS THAN (100),
4 PARTITION t2 VALUES LESS THAN (200)
5 );
Table created
SQL> insert into t values (1);
1 row inserted
SQL> insert into t values (201);
insert into t values (201)
~
ORA-14400: inserted partition key does not map to any partition
To avoid this, you could use a default partition with LESS THAN (MAXVALUE)
:
SQL> CREATE TABLE t (ID NUMBER)
2 PARTITION BY RANGE (ID)
3 ( PARTITION t1 VALUES LESS THAN (100),
4 PARTITION t2 VALUES LESS THAN (200),
5 PARTITION tmax VALUES LESS THAN (MAXVALUE)
6 );
Table created
Author by
P Sharma
Updated on June 14, 2022Comments
-
P Sharma almost 2 years
Anybody can tell me how can we insert data in partitioned table which is not satisfying partitioning condition.