Home > database > How to replace the original record oralce insert? help!
How to replace the original record oralce insert? help!
Time:10-01
Requirements: batch file to import, if have a primary key to repeat the original record is deleted, to import, Practice: 1. Read the file after a record, first select the library have, have, delete, and then insert; The efficiency is too low, the file data is big, 2. Insert directly, the primary key repeat to delete, and then insert; Would you please tell me what the problem do? And what is the most appropriate optimization?
CodePudding user response:
requirements: batch file to import, if have a primary key to repeat the original record is deleted, to import,
From the file to import such operation, you'll have to put the file all records in the pilot into a temporary table, guide with complete, use the unity of the database to merge, finally to empty the temporary table;
Use the merge statement at the time of merger, the building Lord baidu first, there are questions to ask;
CodePudding user response:
The guide into a temporary table, use the merge statement to insert the table again