Re: SQL_SUCCESS_WITH[out]_INFO in ODBC lib

Nathan Bird <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
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.
>
> bye
>   freddy77
>   

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.