Link to home
Start Free TrialLog in
Avatar of Alaska Cowboy
Alaska CowboyFlag for United States of America

asked on

Importing data to Sybase, getting "EOF encountered" error

When I try to import this file (1 record):
0261309333170084904400##7#4#34342036       ^84904400##7#4#34342^213027967000002    ^036^026130933317000  }  

Open in new window


I get this error:
executing... /stars/UTIL/bcpin stars1 dent_temp dent_fix.dat
Tue Oct 15 11:10:09 EDT 2013
Password: 

Starting copy...
Unexpected EOF encountered in BCP data-file.
bcp copy in failed
Tue Oct 15 11:10:09 EDT 2013

Open in new window


The file is generated from a Sql statement on another Unix box and I append "}" to each row in the sql query.

But when I create the file manually with 1 record, it inserts ok . . . So I copy the same data into a blank file without the trailing  }, then simply type in the }, and this loads ok !
executing... /stars/UTIL/bcpin stars1 dent_temp dent_fix_test.dat
Tue Oct 15 11:09:51 EDT 2013
Password: 

Starting copy...
1 rows copied
Tue Oct 15 11:09:51 EDT 2013

Open in new window


What's going on with this ?

I have another process where I take a flat file and append "}" to the end of each record (via SSIS), so apparently Sybase wants this, but why won't it take my file that I create with } at the end ?

I'm pretty sure I don't need any crazy commands, since the command to load my other process is simply
bcpin2_tilde stars1 CBAS_PROV_IDS CBAS_ID.dat

Plus my command where I successfully imported the one record was
bcpin my_db my_table _my_file.dat
ASKER CERTIFIED SOLUTION
Avatar of virtuadept
virtuadept
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Alaska Cowboy

ASKER

good explanation by virtuadept. I used my workaround as explained above as brute force method and I got my data loaded to Sybase.