Thread: COPY function and error log

COPY function and error log

From
"Patrick Hatcher"
Date:
If there function besides COPY that will let me import data from a flat
file and continue if an error occurs?  This was a great functionality of
the MS SQL import that would log the offending error row into an error log.

TIA
Patrick Hatcher
Macys.Com
Legacy Integration Developer
415-932-0610 office




Re: COPY function and error log

From
"Josh Berkus"
Date:
Patrick,

> If there function besides COPY that will let me import data from a
>  flat
> file and continue if an error occurs?

No.  Use a scripting language, such as Perl, PHP, BASH Shellscript, or
 VB to do this.   It's what scripting languages are designed for.
  Heck, you could even use a combo of PgAdminII and MS Access.

If you're not up to doing this, it's a trivial task for a Perl hacker
 or PHP wiz.  2 hours work, tops.

>This was a great functionality
>  of
> the MS SQL import that would log the offending error row into an
>  error log.

When it works.  YMMV, but as an ex-certified MSSQL Server admin, DTS
 failed as often as it succeeded.  I even had MS return my per-incident
 fee on a couple of DTS errors because they couldn't fix them ...

-Josh Berkus