I spent pretty much whole day trying to load data to Oracle Database. The problem was that partitions should be created automatically while data is loaded but this code apparently didn't work.
So I was getting:
java.sql.SQLException: ORA-14400: inserted partition key does not map to any partition
ORA-06512: at "####################.#########", line 307
and when I was trying to create partition manually:
java.sql.SQLException: ORA-20000: QEM00000000000000002296-ORA-00936 : Unanticipated error occured in PrepareMsgStream. At RunPoint, Adding a partition to MSGBLOB.
The code to create the partition looks like that:
v_DDL := 'ALTER TABLE '||v_TableName||' ADD PARTITION '||v_PartitionName;
v_DDL := v_DDL ||' VALUES LESS THAN ('||v_HighValue||') TABLESPACE '||v_TableSpace;
v_DDL := v_DDL ||' LOB (BlobData) STORE AS '||v_PartitionName||' (TABLESPACE '||v_TableSpace||')';
EXECUTE IMMEDIATE v_DDL;
The problem was with helper function which gets v_HighValue... so it's good to use Dbms_Output.Put_line(v_DDL); to make sure you are executing the code you think you execute ;)
Monday, 3 August 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment