[freetds] bcp CHAR behavior

James K. Lowden jklowden at schemamania.org
Fri Apr 16 18:01:55 EDT 2004


On Fri, 16 Apr 2004, Michael Peppler <mpeppler at peppler.org> wrote:
> Note that the char(20) column is *padded* to the correct width, while
> the varchar() column is trimmed. I suspect that you will have to become
> a little more precise for char() columns, and either pad or truncate as
> needed to match the target column's width.

I suppose the best logic is to initialize the wire buffer to spaces, move
the data from the file into the buffer, and complain if it doesn't fit.  

I'll look again.  It might be that our char->char dbconvert() doesn't pad
out the target.  It probably should.  

Thanks, Michael.  

--jkl



More information about the FreeTDS mailing list