freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Frediano Ziglio <freddyz77 AT tin.it>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: need some help with freebcp
- Date: 23 Oct 2002 22:11:49 +0200
Il mer, 2002-10-23 alle 21:55, Lowden, James K ha scritto:
> > 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?
>
No, the wire return some thing like "\001a" for convert(char(3),'a'),
string stripped by spaces.
Mmm... returning a select convert(char(4),'a') to a buffer of say.. 10
character return "a " and a length of 4 ??
freddy77
-
Re: need some help with freebcp
, (continued)
- Re: need some help with freebcp, Brian Bruns, 10/23/2002
- Re: need some help with freebcp, James K . Lowden, 10/23/2002
- Re: need some help with freebcp, Wilson, John, 10/23/2002
- Re: need some help with freebcp, Wilson, John, 10/23/2002
- Re: need some help with freebcp, Thompson, Bill D (London), 10/23/2002
- Re: need some help with freebcp, Thompson, Bill D (London), 10/23/2002
- Re: need some help with freebcp, Castellano, Nicholas, 10/23/2002
- Re: need some help with freebcp, Frediano Ziglio, 10/23/2002
- Re: need some help with freebcp, Frediano Ziglio, 10/23/2002
- Re: need some help with freebcp, Lowden, James K, 10/23/2002
- Re: need some help with freebcp, Frediano Ziglio, 10/23/2002
- Re: need some help with freebcp, Wilson, John, 10/23/2002
Archive powered by MHonArc 2.6.24.