开发者

How to find missing record from a file?

Edited:

There is a file has 5000 recor开发者_C百科ds that are parsed and loaded into Oracle database table. after the completing the process the results will be logged into a file that will show the success and failure counts. There it has only 4999 records are success. 1 record is not inserted (may be it not formatted correctly).

I need to find out the record from file that was not loaded into database. it not easy to check the record one by one. Is there any simple way to do it?

thanks


I must agree with @Adam Paynter in that you give very little detail about how and what is inserting the data.

Said this, if you can delete and reinsert those 4000 records I would suggest to change your loading procedure so that when an insertion fails it puts into the log the values that SQLCODE and SQLERRM return plus the record data.

You should then easily see what caused the error and which record is failing.

EDIT: since you can not touch the import source nor the data in the table you could try to create your own "import" procedure to check against the table data. It should be something in the style of:

  1. For each record in the file get all the necessary fields to univoquely identify a record.
  2. Check against the table if a record with that exact data exists. If the answer is yes go to step 1.
  3. If the answer is no, you got the missing record.

HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜