0

Getting the following error when copying an input file into an empty db table. The input file only has 56732 rows, however I am getting an error on row 56733:

continue
* * * * * * * * * *
copy table temptable
(
abc     = c(3),
bcao    = c(1),
cba     = c(10),
test    = c(1)nl   
)
from 'tempfile'
Executing . . .

E_CO0024 COPY: Unexpected END OF FILE while processing row 56733.

E_CO002A COPY: Copy has been aborted.

Anyone have any ideas why its trying to process an extra row? I have four other files the exact same format with different data and it processes fine.

Have no idea why this is happening...

TCP
  • 33
  • 2
  • 8

1 Answers1

2

The most likely cause is that you have some spaces or similar after your final row of data. You have set a new line as a delimiter on test, so the file needs to end with a new line. Delete anything after your data which isn't a blank new line.

As an example. Using the code below:

DECLARE GLOBAL TEMPORARY TABLE test (
    v int
) ON COMMIT PRESERVE ROWS WITH NORECOVERY;

COPY test (
    v = c(5)nl
) FROM 'J:\test.csv';

Will result in an error on line 4 for the following data:

34565
37457
35764
45685

and error on line 5 for this data (punctuation used to show issue, but it is probably a space or tab in your own file):

34565
37457
35764
45685
.
littlefeltfangs
  • 396
  • 2
  • 17