Unix Technical Forum

Displaying truncated rows during bcp

This is a discussion on Displaying truncated rows during bcp within the Sybase forums, part of the Database Server Software category; --> Hi, I'm bcp'ing in a large volume of data with this command : bcp database..BcpTable in datafile -Uusername -Ppasswd ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 04:05 PM
Olufemi Anthony
 
Posts: n/a
Default Displaying truncated rows during bcp

Hi, I'm bcp'ing in a large volume of data with this command :

bcp database..BcpTable in datafile -Uusername -Ppasswd -SSERVER -c
-t\\t -r\\n -e bcp.err

and I get the following message:

Starting copy...
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.

....
1257 rows copied.
Clock Time (ms.): total = 1 Avg = 0 (1257000.00 rows per sec.)


Is there any way for me to see which rows were truncated before
insertion into the table? They don't show up in the errors file I
specified. Please cc: femi@cnet.com when sending a response.

Thanks,
Femi
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 04:05 PM
Neal
 
Posts: n/a
Default Re: Displaying truncated rows during bcp

Hello,

I don't know how to find out which row was truncated
before it is inserted into the table. If the column
being truncated is character, the row will still be
inserted because the truncation is considered a warning.

Feature Request number 236085 was filed to record the
row/column being truncated. No customer support cases
are associated with this request and consequently it
has a very low priority.

One way to find out which row was truncated after it was
inserted into the table is to use a batch size of 1:

% bcp tempdb..t1 in test.txt -Usa -P -c -eerr.txt -b 1

Starting copy...
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
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.
Batch successfully bulk-copied to SQL Server.
Batch successfully bulk-copied to SQL Server.
4 rows copied.
Clock Time (ms.): total = 1 Avg = 0 (4000.00 rows per sec.)

Since the truncation warning appears before the third
success message, I know the third row was the one that
was truncated.

Another method would be to use the "-F" and "-L" parameters
to cut the data into chunks and narrow down the problematic
row.

Maybe other users have different methods?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 04:05 PM
Olufemi Anthony
 
Posts: n/a
Default Re: Displaying truncated rows during bcp

I've been able to figure out which rows had the problem using a batch
size of 1, and obtaining the line #s at which the warning occurred.

Thanks a lot.
Femi

lucky_justin69@yahoo.com (Neal) wrote in message news:<498321de.0311120812.64f0123@posting.google.c om>...
> Hello,
>
> I don't know how to find out which row was truncated
> before it is inserted into the table. If the column
> being truncated is character, the row will still be
> inserted because the truncation is considered a warning.
>
> Feature Request number 236085 was filed to record the
> row/column being truncated. No customer support cases
> are associated with this request and consequently it
> has a very low priority.
>
> One way to find out which row was truncated after it was
> inserted into the table is to use a batch size of 1:
>
> % bcp tempdb..t1 in test.txt -Usa -P -c -eerr.txt -b 1
>
> Starting copy...
> Batch successfully bulk-copied to SQL Server.
> Batch successfully bulk-copied to SQL Server.
> 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.
> Batch successfully bulk-copied to SQL Server.
> Batch successfully bulk-copied to SQL Server.
> 4 rows copied.
> Clock Time (ms.): total = 1 Avg = 0 (4000.00 rows per sec.)
>
> Since the truncation warning appears before the third
> success message, I know the third row was the one that
> was truncated.
>
> Another method would be to use the "-F" and "-L" parameters
> to cut the data into chunks and narrow down the problematic
> row.
>
> Maybe other users have different methods?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com