[freetds] bcp is really busted

Thompbil18 at aol.com Thompbil18 at aol.com
Tue Dec 30 04:22:23 EST 2003


Hi Christos, James,

It's just great that more of the bcp functionality is being used and tested. 
However, it's a shame that these issues come up when I am powerless to do any 
testing/fixes myself. Never mind - I am back at work on Friday. 

Our issues are confined to "native format" files, right ? I guess this area 
got some testing when first written, but probably didn't receive as much 
attention as character format files then or subsequently. Christos may be the first 
to use this functionality seriously.

In the bcp code, Nullable chars/varchars and "empty" chars have been 
problematic historically. The "empty" char issue  is especially interesting. 
AIUI , you can't have such things in Sybase. As James has discovered, the 
empty string ( '' or "" ) is interpreted by Sybase as a single blank. 
The differences with SQL server 2000 are understood, but not always that easy 
to find in the documentation. See "sp_dbcmptlevel" in SQL server online help 
for a discussion of some interesting differences between SQL 6.5 (and by 
association Sybase) and SQL 2000.

I don't *think* that this should be too difficult to fix. Although James may 
be right that we can just "dump the buffer" for native format files,  the 
existing code should be able to handle this problem with a little adjustment. It 
was designed to cope with character format files, native format files and the 
special "format" format files that bcp supports ( Let's not go there for the 
time being, though  :-)  ) 

There are two other things I'd like to mention.

First sqsh, and it's ability to do "bcp" type stuff.  This uses the 
ct-library bcp functions, so until we get those done , we can't use it.

Second, Christos needs a program to do fast data transfer between two data 
sources. 
I have such a program, which I've used to migrate Sybase data into SQL 
Server. 
It's VERY fast , but limited in the breadth of support for different column 
types. It'll do chars, varchars, ints, floats, dates, and maybe numerics (I'll 
need to check). Also the command line is a bit cludgy, but you could live with 
that I dare say. If you're interested, maybe I can let you have a copy when I 
get back to work.

Bill 
(a.k.a.  Dr Thompson )






More information about the FreeTDS mailing list