Re: LOAD (ignoring errors)
Posted in 1997
aheller@visa.com wrote:
>
> What I'd really like to do is run the LOAD command within DB-ACCESS and
> have LOAD ignore any errors it gets along the way (instead of blowing
> up). Does anyone know if this is possible (if so, the syntax) or do I
> have to use DBLOAD
>
> Thanks in advance
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
If your database server is version 7.10.UD1 or later you can use
START VIOLATIONS TABLE FOR mytable;
SET INDEXES, CONSTRANTS FOR mytable FILTERING WITHOUT ERROR;
LOAD FROM "load_file" INSERT INTO mytable;STOP VIOLATIONS TABLE FOR mytable;
The START VIOLATIONS will create two tables mytable_vio and mytable_dia.
What happens is that when a unique index or a constraint for the table
would be violated, the row with the error will go into the table called
mytable_vio instead of mytable, and a row with explanation will be
stored in the table called mytable_dia.
If you are not interested the errors, then just
DROP TABLE mytable_vio;
DROP TABLE mytable_dia;
--
best regards
+-------------------------------------------------------------+
| Claus Samuelsen Sysdeco Danmark A/S |
| Project Manager Gydevang 22B |
| email: csa@sysdeco.dk DK-3450 Aller'd |
| phone: +45 4814 3000 Denmark |
+-------------------------------------------------------------+