[freetds] SQL_SUCCESS_WITH[out]_INFO in ODBC lib

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Tue Apr 29 11:11:33 EDT 2008


> 
> ZIGLIO, Frediano, VF-IT wrote:
> >> Nathan Bird wrote:
> >>     
> >>> Reading data in chunks with SQLGetData if the buffer is not 
> >>>       
> >> long enough 
> >>     
> >>> for the value to copy, it should fill the buffer, and return 
> >>> SQL_SUCCESS_WITH_INFO, along with setting the 
> >>>       
> >> StrLen_or_IndPtr to point 
> >>     
> >>> at the how much data is available. At least according to  
> >>> http://msdn2.microsoft.com/en-us/library//ms715441.aspx [1] 
> >>>       
> >> the info 
> >>     
> >>> should be "01004" to indicate the string is right 
> >>>       
> > -			/* not all readed ?? */
> > -			if (colinfo->column_text_sqlgetdatapos <
> > colinfo->column_cur_size)
> > -				/* TODO add diagnostic */
> > +			
> > +			if (colinfo->column_text_sqlgetdatapos <
> > colinfo->column_cur_size) {	/* not all read ?? */
> > +				odbc_errs_add(&stmt->errs, "1004",
> > "String data, right truncated");
> >  				ODBC_RETURN(stmt,
> > SQL_SUCCESS_WITH_INFO);
> > +			}
> >
> > IMO is correct!
> > 2 is ok, even odbc refer as remaining bytes.
> > I would merge part 3 in 0.82 and 2 and 3 in CVS HEAD.
> >
> 
> I've been wanting to test this before responding again, but haven't 
> gotten a chance--nor am I likely to soon. So real quick: 
> Shouldn't that 
> string be "01004" instead of "1004"?  That's what the code on 
> my end is 
> expecting and what 
> http://msdn2.microsoft.com/en-us/library//ms715441.aspx says...
> 
> Thanks
> Nathan

Opss... only a typo error, fixed in CVS.

Thanks,
  Frediano



More information about the FreeTDS mailing list