I am trying to import data into table from a csv file, the column names are same and datatype matches. While i try to import I am hitting with below error.
DDL :
CREATE TABLE "HR"."USER_PARTITION"
( "SERIAL_ID" NUMBER,
"ACCOUNT_GUID" VARCHAR2(18 CHAR),
"MEMBER_ACCESS_LEVEL" VARCHAR2(80 CHAR),
"USER_GUID" VARCHAR2(18 CHAR),
"ACCOUNT_ACCESS_LEVEL" VARCHAR2(40 CHAR),
"SHARE_ACCOUNT_GUID" VARCHAR2(18 CHAR),
"CASE_ACCESS_LEVEL" VARCHAR2(40 CHAR),
"OPPORTUNITY_ACCESS_LEVEL" VARCHAR2(40 CHAR),
"USER_GROUP_GUID" VARCHAR2(18 CHAR),
"STATUS" VARCHAR2(20 CHAR),
"TEAM_MEMBER_ROLE_NAME" VARCHAR2(180 CHAR),
"COUNTRY_CODE" VARCHAR2(60 CHAR),
"REGION" NUMBER,
"ACCOUNT_ID" NUMBER,
"BADGE_NUMBER" VARCHAR2(18 CHAR),
"CREATION_DATE" DATE DEFAULT NULL,
"PROCESS_FLAG" VARCHAR2(1 BYTE) DEFAULT 'N',
"REC_INSERT_DATE" DATE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
PARTITION BY RANGE ("REGION")
SUBPARTITION BY LIST ("PROCESS_FLAG")
(PARTITION "P_REGION1" VALUES LESS THAN (2)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION1_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION1_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION2" VALUES LESS THAN (3)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION2_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION2_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION3" VALUES LESS THAN (4)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION3_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION3_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION4" VALUES LESS THAN (5)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION4_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION4_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION5" VALUES LESS THAN (6)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION5_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION5_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION6" VALUES LESS THAN (7)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION6_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION6_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION7" VALUES LESS THAN (8)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION7_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION7_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION8" VALUES LESS THAN (9)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION8_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION8_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION9" VALUES LESS THAN (10)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION9_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION9_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION10" VALUES LESS THAN (11)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
( SUBPARTITION "P_REGION10_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION10_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION11" VALUES LESS THAN (12)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION11_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION11_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION12" VALUES LESS THAN (13)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION12_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION12_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION13" VALUES LESS THAN (14)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION13_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION13_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION14" VALUES LESS THAN (15)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION14_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION14_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION15" VALUES LESS THAN (16)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION15_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION15_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION16" VALUES LESS THAN (17)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION16_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION16_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION17" VALUES LESS THAN (18)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION17_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION17_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION18" VALUES LESS THAN (19)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION18_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION18_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION19" VALUES LESS THAN (20)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION19_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION19_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ,
PARTITION "P_REGION20" VALUES LESS THAN (21)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS NOLOGGING
( SUBPARTITION "P_REGION20_Y" VALUES ('Y') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ,
SUBPARTITION "P_REGION20_N" VALUES ('N') SEGMENT CREATION IMMEDIATE
STORAGE(
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SC_DATA01"
NOCOMPRESS ) ) ENABLE ROW MOVEMENT
CSV file contains region column with regions 1-10
Here is the partition range values
INSERT STATEMENT:
INSERT INTO USER_PARTITION
(SERIAL_ID, ACCOUNT_GUID, MEMBER_ACCESS_LEVEL, USER_GUID,
ACCOUNT_ACCESS_LEVEL, SHARE_ACCOUNT_GUID, CASE_ACCESS_LEVEL,
OPPORTUNITY_ACCESS_LEVEL, USER_GROUP_GUID, STATUS,
TEAM_MEMBER_ROLE_NAME, COUNTRY_CODE, REGION, ACCOUNT_ID,
BADGE_NUMBER, CREATION_DATE, PROCESS_FLAG,
REC_INSERT_DATE)
VALUES
(5095611237,'0017000000UWQ2WAAX','Edit','005A0000006zU2qIAE',
'Edit','0017000000UWP2QAAX','Edit',
'Edit','005A0000007cU2qIAE','I',
'3rd Party Software TSR','FJ',1,2224808630,
'1111441', to_date('29-Apr-22', 'DD-MON-RR'), '',
to_date('29-Apr-22', 'DD-MON-RR'));
ERROR: Error starting at line : 8 in command -
Error report - ORA-14400: inserted partition key does not map to any partition
CodePudding user response:
Not all the new elements you have are matching one of your partitions. To solve this issue by the creation of one or more further partitions, like
alter table "HR"."USER_PARTITION" add partition <some name> values less than <the highest REGION in your csv 1>;
CodePudding user response:
Your table is partitioned by REGION, subpartitioned by PROCESS_FLAG. There are partitions for REGION = 1 through 20, and subpartitions in each region for PROCESS_FLAG in ('Y', 'N'). If you have any values in your spreadsheet for REGION which are not in the range of 1..20, or values for PROCESS_FLAG which are not 'Y' or 'N' then you'll get the error you're getting. You'll have to check your data and identify the row(s) which have values which are not in the list of valid values above, and then either fix the data or add partitions to your table.