[freetds][freetds-Patches-731907]Choosingdatalengthwhenbindingfixed types

Arnar Birgisson arnarb at oddi.is
Thu May 8 09:23:41 EDT 2003


James and Frediano: Thanks heaps for your explanations, I really
appreciate them (or it? My english needs some polishing). This allows me
to continue using freetds for my project without taking the chance that
things will break if I upgrade (at least if they do, I will know how to
fix them). Understanding this is important to me as I frequently tweak
code to suit my needs.

I would be interested to offer some of my time to help in the
development of FreeTDS, but as things are right now, I don't have much
of it to give :-/

Arnar

> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org 
> [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of 
> Frediano Ziglio
> Sent: 8. maí 2003 06:16
> To: FreeTDS Development Group
> Subject: RE: 
> [freetds][freetds-Patches-731907]Choosingdatalengthwhenbinding
> fixed types
> 
> 
> Il mer, 2003-05-07 alle 17:43, Arnar Birgisson ha scritto:
> > > Hope that clears things up a bit.  :-)
> > 
> > It does indeed.. thanks.
> > 
> > According to this though, is that tds_set_column_type should have
> > checked to see if we're speaking tds 7+ and in that case 
> map SYBVARCHAR
> > to XSYBVARCHAR, and vice versa for lower versions of the 
> protocol? Is
> > there any reason to keep the ability to specify SYBVARCHAR 
> (the old one)
> > explicitly when talking tds 7+ ?
> > 
> > Arnar
> > 
> 
> Well, you as client didn't know the protocol version you are 
> talking...
> You call dblib passing SQLVARCHAR (or whatever constant) and
> libTDS/DB_Library should do all necessary to pass XSYBVARCHAR. 
> tds_set_column_type was written to set type from server but used
> nowadays to set type TO server. If is our intention to set 
> param type we
> should do a wrapper in libTDS like this:
> 
> void
> tds_set_param_type(TDSSOCKET * tds, TDSCOLINFO * curcol, 
> TDS_SERVER_TYPE
> type)
> {
> 	/* translate type to best handle server */
> 	if (IS_TDS7_PLUS(tds)) 
> 		switch(type) {
> 		case SYBVARCHAR:
> 			type = XSYBVARCHAR;
> 			break;
> 		case SYBCHAR:
> 			type = XSYBCHAR;
> 			break;
> 		case SYBBINARY:
> 			...
> 		case SYBVARBINARY:
> 			...
> 		}
> 	tds_set_column_type(curcol, type);
> }
> 
> Removing cardinal type only from tds_set_param_type isn't a 
> good idea...
> 
> freddy77
> 
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> 




More information about the FreeTDS mailing list