Thread: COPY error with null date

COPY error with null date

From
Ashmita Jain
Date:

It is taking date as an empty string.

Try defining the empty field as ‘\N’ in your source file.



::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------

Re: COPY error with null date

From
Rajeev rastogi
Date:

On 21st March 2014, Ashmita Jain Wrote:

 

>It is taking date as an empty string.

>Try defining the empty field as ‘\N’ in your source file.

 

‘\N’ in copy source file always results into an empty string (unless something written in new line), which is correct only.

So COPY from such source file will always fail except for the case if the column data-type is string.

 

In your case COPY is failing or it is able to insert empty string?

 

 

Thanks and Regards,

Kumar Rajeev Rastogi

 

Re: COPY error with null date

From
Alban Hertroys
Date:
On 24 Mar 2014, at 5:32, Rajeev rastogi <rajeev.rastogi@huawei.com> wrote:

> On 21st March 2014, Ashmita Jain Wrote:
>
> >It is taking date as an empty string.
> >Try defining the empty field as ‘\N’ in your source file.
>
> ‘\N’ in copy source file always results into an empty string (unless something written in new line), which is correct
only.
> So COPY from such source file will always fail except for the case if the column data-type is string.

You appear to be confusing \N with \n. Those are very different escape codes; the second means new line, while the
firstmeans NULL. 

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.