Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2014
    Posts
    1

    Unanswered: sybase bcp errors

    I get errors when I try to upload a datafile using bcp.
    CSLIB Message: - L0/O0/S0/N36/1/0:
    cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.

    I had to painstakingly examine my data to figure out what was causing the data.
    Why is sybase bcp so bad at reporting error info?
    Is there a way to get a line and column number? That shouldnt be that hard Im guessing.

  2. #2
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    This is one of the most frustrating errormessages BCP gives. I don't have a solution to offer, only my deepest sympathies...
    I'm not crazy, I'm an aeroplane!

  3. #3
    Join Date
    Jan 2012
    Location
    Lisbon
    Posts
    115
    Provided Answers: 1
    Hi,

    I don't know how many rows you have, but you can bcp in by batches. And go norrowing down.

    You can also use start line and end line for bcp. Until you get it like a number of rows you can manually verify.

    Or check the destination table to see if you have same ddl of source.

    Other than that if you think is just a couple of rows, you can bypass the error and then compare the souce vs dest to see which line(s) are different and update them....

  4. #4
    Join Date
    Feb 2012
    Posts
    133
    try another method.

    bulk copy in the file to some temporary table then use select into to copy back in the records to original table. see if it will gives you some errors.

  5. #5
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    user the -e flag to trap overflow errors
    e.g.
    Code:
    1> create table t1 (c1 int, c2 char(3))
    
    $ cat t1.txt
    1,abc
    1234567890123,err
    3,xyz
    $ bcp tempdb..t1 in t1.txt -U xxx -Pxxx -Sxxx -c -t, -r'\n' -e t1_bcp.err
    
    Starting copy...
    CSLIB Message:  - L0/O0/S0/N20/1/0:
    cs_convert: cslib user api layer: common library error: The conversion/operation resulted in overflow.
    bcp copy in partially failed
    
    2 rows copied.
    Clock Time (ms.): total = 7  Avg = 3 (285.71 rows per sec.)
    $ cat t1_bcp.err
    #@ Row 2, Column 1: CSLIB Message:  - L0/O0/S0/N20/1/0:
    cs_convert: cslib user api layer: common library error: The conversion/operation resulted in overflow. @#
    #@ Row 2: Not transferred @#
    1234567890123,err
    
    1> select * from tempdb..t1
    2> go
     c1          c2  
     ----------- --- 
               1 abc 
               3 xyz 
    
    (2 rows affected)
    Truncation is not an error e.g.
    Code:
    1> insert into tempdb..t1 values (9,'nine')
    2> go
    (1 row affected)
    1> select * from tempdb..t1 where c1=9
    2> go
     c1          c2  
     ----------- --- 
               9 nin 
    
    (1 row affected)
    Last edited by pdreyer; 06-23-14 at 07:15.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •