Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bcp and CSLIB message

76 views
Skip to first unread message

Craig A. Rosen

unread,
Oct 24, 2000, 3:00:00 AM10/24/00
to
Can anyone help me out with this one.

I am converting a Sybase ASE 11.0.2.1 database to a 12.0.0.1 database (SWR
9277 ESD 2/NT) and I have used bcp to output my data and then am attempting
to bring the data into my 12 database (same schema structure)

I am receiving the following error:

CSLIB message: L0/O0/S0/N24/1/0
cs-convert:cslib user api layer:
common library error: the conversion/operation was skipped due to a syntax
error in the source field.

Okay - I am using bcp with a very large script and it is difficult for me to
target the source of this error becuase it runs off my screen and if hard to
follow. Does anyone out there have any experience with this type of
conversion problem and does anyone have a relatively easy method for
debugging the source of this type of error. I would be greatful for any
assistance in this matter.

Sincerely,

Craig Rosen
c...@stanleyassociates.com
703-684-1125 x475

Anthony Mandic

unread,
Oct 25, 2000, 3:00:00 AM10/25/00
to
"Craig A. Rosen" wrote:
>
> Can anyone help me out with this one.
>
> I am converting a Sybase ASE 11.0.2.1 database to a 12.0.0.1 database (SWR
> 9277 ESD 2/NT) and I have used bcp to output my data and then am attempting
> to bring the data into my 12 database (same schema structure)

You don't mention if your source server is NT as well. If it is,
why not just dump and load or upgrade in place? You can also bcp
with native format. This may bypass your error.

> I am receiving the following error:
>
> CSLIB message: L0/O0/S0/N24/1/0
> cs-convert:cslib user api layer:
> common library error: the conversion/operation was skipped due to a syntax
> error in the source field.
>
> Okay - I am using bcp with a very large script and it is difficult for me to
> target the source of this error becuase it runs off my screen and if hard to
> follow. Does anyone out there have any experience with this type of
> conversion problem and does anyone have a relatively easy method for
> debugging the source of this type of error. I would be greatful for any
> assistance in this matter.

You would need to break up the bcp batch sizes so that you could
target the problematic line more easily. For example, if the batch
size is 100, you would only need to check 100 lines of data (once
you've advanced to the correct starting line).

-am

Craig A. Rosen

unread,
Oct 25, 2000, 3:00:00 AM10/25/00
to
Anthony,

I really appreciate your response, thank you.

My source server is indeed NT. I really wish I could just dump and load,
but given the circumstances, the person who initially setup the server set
it up with dramatic overallocations for the databases that exist on the
server. Thus, to dump and load, I would need to reatin the same size
databases - and I need to bring the sizes down a great deal.

I am really not that skilled with bcp (yet) still learning. Any information
you could offer me would help me out at this point, like what exactly native
format is, etc. I'll give you an example bcp command I am using:

bcp CP_DB..trkch out e:\PVCS_Admin\dataout\15trkch.bcp -Usa -P -SCRAIG -c
bcp CP_DB..trkch in e:\PVCS_Admin\dataout\15trkch.bcp -Usa -P -SCRAIG -c

When I run many of these commands in one batch file, it is very difficult
for me to follow where the file errors out - I am not sure how to get a
"log" file to track potential bcp errors. So I am kind of stuck now.

It may even be a good idea for me to dump and load (bcp style) into the old
database (11x), shrink it, then actually the real dump and load for
upgrading.....hmmmm. I'll have to think that one over.

Craig Rosen
c...@stanleyassociates.com

"Anthony Mandic" <amandic@*t.com.au> wrote in message
news:UmvSs3l...@forums.sybase.com...

Craig A. Rosen

unread,
Oct 25, 2000, 3:00:00 AM10/25/00
to

Brian Funston

unread,
Oct 25, 2000, 3:00:00 AM10/25/00
to
Hi Craig -

You could try this in your bcp to help pinpoint your error:

bcp CP_DB..trkch out e:\PVCS_Admin\dataout\15trkch.bcp -Usa -P -SCRAIG -c
bcp CP_DB..trkch in e:\PVCS_Admin\dataout\15trkch.bcp -Usa -P -SCRAIG -c

-e15trkch.err > 15trkch.out

This will give you an error file from bcp with hopefully a descriptive message,
and an Out file, so it won't scroll off your screeen. By the way - if you are
Bcping Textfields with the -c option you may be encountering embedded cariage
returns,etc in the bcp file. Like Anthony said, you may be better off with the
-n (native mode) option of bcp.


Brian.

Anthony Mandic

unread,
Oct 26, 2000, 3:00:00 AM10/26/00
to
"Craig A. Rosen" wrote:

> My source server is indeed NT. I really wish I could just dump and load,
> but given the circumstances, the person who initially setup the server set
> it up with dramatic overallocations for the databases that exist on the
> server. Thus, to dump and load, I would need to reatin the same size
> databases - and I need to bring the sizes down a great deal.

There may be scope to shrink the db size, but it depends on a few
factors. Bret Halford's write up for this is in the Sybase FAQ at
http://www.isug.com/Sybase_FAQ

> I am really not that skilled with bcp (yet) still learning. Any information
> you could offer me would help me out at this point, like what exactly native
> format is, etc. I'll give you an example bcp command I am using:
>
> bcp CP_DB..trkch out e:\PVCS_Admin\dataout\15trkch.bcp -Usa -P -SCRAIG -c
> bcp CP_DB..trkch in e:\PVCS_Admin\dataout\15trkch.bcp -Usa -P -SCRAIG -c

The "-c" option means character mode. Try "-n" or native mode. This
will make the files smaller too and bypass some issues as Brian F.
mentioned. Are the character sets the same on the two servers?

> When I run many of these commands in one batch file, it is very difficult
> for me to follow where the file errors out - I am not sure how to get a
> "log" file to track potential bcp errors. So I am kind of stuck now.
>
> It may even be a good idea for me to dump and load (bcp style) into the old
> database (11x), shrink it, then actually the real dump and load for
> upgrading.....hmmmm. I'll have to think that one over.

Yes, you can create a new db in the old server and use "select into"
to copy the data internally. Then dump and load that db. You could also
try remote server copies with CIS or a server to server bcp. You'd need
a tool that uses the BCP API to do this. My tool (BCPTool) does this but
I only have versions for Linux and Solaris. If you have one of these in
your office, the tool can be had from http://www.mbay.net/~mpeppler/bcptool
Scott Gray's sqsh also does this via a command line interface. I think
that there is a version for NT. The FAQ has the link to it.

-am

0 new messages