[freetds] bcp is really busted

Christos Zoulas christos at zoulas.com
Tue Dec 30 08:17:05 EST 2003


On Dec 30,  4:22am, Thompbil18 at aol.com (Thompbil18 at aol.com) wrote:
-- Subject: Re: [freetds] bcp is really busted

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

Not to worry, I found out about the problem in October, and I told James
but did nothing about it till now. So a few more days won't hurt.
|
| 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.

Yes. I have not used the delimited format though. I can check and report.

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

Thanks for the explanation. It is clear what was happening in James example.

| 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  :-)  ) 

Yes, you are more familiar with the code so it will take you much less time
to fix than me. Please also check the other fix that I sent. There may be
a better way to do it.

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

Thanks, I'd be happy to give that a spin.

christos


More information about the FreeTDS mailing list