raja pl sql
raja pl sql

Reputation: 1

how to solve the partition range partition

i have table like

create table t1 (
    name varchar2(10),
    pdate date
) partition by range(pdate) (partition p1 values less than('01-jan-16'),partition p2 values less than('01-feb-16));

now i am insert the values '06-aug-16' then this values is inserted or error?

Upvotes: 0

Views: 35

Answers (1)

tale852150
tale852150

Reputation: 1628

It will fail unless you create a partition that captures everything else outside of your existing partition range(s).

Use for example:

create table t1 (name varchar2(10), pdate date)
partition by range(pdate)
 (partition p1 values less than('01-jan-16'),
  partition p2 values less than('01-feb-16'),
  partition p3 values less than(MAXVALUE));

Then any date that does not fit into your other partitions will be inserted into p3.

Upvotes: 2

Related Questions