Error when uploading integers

View: New views
2 Messages — Rating Filter:   Alert me  

Error when uploading integers

by romsok :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I ran into the following problem:

I used the COPY command to upload a large number of records and I got an error saying that a particular field was expecting an int. In the file which I am trying to upload fields are separated with commas ",", and records are separated with new-line characters - "\n".
The value it was trying to upload and failed was basically an empty field - ",,". I worked around the problem by setting every entry in the column that was not set to zero - so the field would get its int, and later changing it back to null in the table. But it seems like a common task to upload null values into an integer column, so why would it fail?

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MonetDB-users mailing list
MonetDB-users@...
https://lists.sourceforge.net/lists/listinfo/monetdb-users

Re: Error when uploading integers

by Martin Kersten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Roman Sokolyuk wrote:

> Hi,
>
> I ran into the following problem:
>
> I used the COPY command to upload a large number of records and I got an
> error saying that a particular field was expecting an int. In the file
> which I am trying to upload fields are separated with commas ",", and
> records are separated with new-line characters - "\n".
> The value it was trying to upload and failed was basically an empty
> field - ",,". I worked around the problem by setting every entry in the
> column that was not set to zero - so the field would get its int, and
> later changing it back to null in the table. But it seems like a common
> task to upload null values into an integer column, so why would it fail?
Input errors are amongst the most notorious to check by a user. The input line
returned and/or error message often gives a good indication of the violation.
Empty fields are converted to NULL values, unless the NULL value representation
is explicitly overruled in the COPY command.

In case of doubt where to look for the error, extract the violated line
and copy it into your table to assure that it is not a side-effect of
e.g. an error in earlier fields, such as a field separator as part of
a string field.

See the documentation for further details.

regards, Martin

>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> MonetDB-users mailing list
> MonetDB-users@...
> https://lists.sourceforge.net/lists/listinfo/monetdb-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
MonetDB-users mailing list
MonetDB-users@...
https://lists.sourceforge.net/lists/listinfo/monetdb-users