Re: "Load from" SQL Statement ...
Posted in 1998
You did not mention, what version of Informix you are using. Assuming you are using 7.22. Do the following, SET INDEXES idx_name DISABLED; START VIOLATIONS TABLE FOR tab_name; SET INDEXES idx_name ENABLED even better, SET INDEXES idx_name FILTERING WITHOUT ERROR load data All the duplicate records will go to the violations and diagnostic table. You can debug the violations table to correct the offending records and load them into the main table. You will have to have: DBA privilege or Owner of the target table and have resource privilege OR Alter privilege on the target table and have resource privilege. Read the documentation for START VIOLATIONS TABLE in the syntax guide. Rick Nath <rnath@wrbc.com> wrote in article <01bd7f85$70eb5210$2fdda8c0@bis005408>... > I was wondering if anyone has stumbled upon a way in which to continue > processing a 'load' file even after it has encountered an error (such as > duplicate key) within the file? We have process written that takes a > delimited file and attempts to load. If there are no errors everything is > fine. However if there is an error such as a duplicate key, the loading of > the entire file stops and we are forced to go through the entire file to > find the bad record, remove it, and restart the process. Other options > such as SPs and 4GL are welcome. > > Rick Nath >