Skip to content
June 15, 2012 / doganay

ORA-14400: inserted partition key does not map to any partition (when inserting null date)

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Hi,

You may hit

ORA-14400: inserted partition key does not map to any partition

error usually. But this case is a bit different.
When you insert a date value as null and that table is range partitioned by that date column,
you hit this error, too. Because null date value can not be inserted to any of partitions.

So, it’s a good way to alter that column in order to be not null:

alter table doganay.table1
modify
(
 mydatecol1 not null
);

You can use this query to retrieve those cols:

select a.owner, a.name, b.column_name from DBA_PART_KEY_COLUMNS a, dba_tab_cols b
where
a.object_type='TABLE' and
a.name=b.table_name and
b.column_name=a.column_name and
b.nullable='Y'
order by 1,2,3;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: