Skip to Content.
Sympa Menu

freetds - Re: need some help with freebcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: need some help with freebcp
  • Date: Wed, 23 Oct 2002 15:55:17 -0400


> From: Frediano Ziglio [mailto:freddyz77 AT tin.it]
> Sent: October 23, 2002 2:48 PM
>
> It seem that some library (all?) pad SYBCHAR with
> spaces until the length so 'xyz' became 'xyz ' converted to CHAR(6).
> ODBC act in such way, other, I don't know/remeber. I think
> best solution
> (if all library use padding) is padding in token.c, after reading from
> wire and fixing column_cur_size.

I don't know what happens on the wire, but I do know that char columns are
blank-padded and varchar are not. In db-lib, the behavior is controlled by
dbbind().

Consider:

1> create table #a( c char(3), v varchar(3) )
2> insert #a values ('c', 'v')
3> select *, c+v, v+c from #a
4> go
(1 row affected)
c v
--- --- ------ ------
c v c v vc

That's what db-lib would give you, too, if you used CHARBIND. Isn't that
how it's transmitted, too?

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page