Re: "Data conversion resulted in overflow" with float constants

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Wed, 12 Jun 2013 17:56:32 -0430
arielCo <[email protected]> wrote:

> 1>> select 100.0 foo
> 2>> go
> foo
> ---
> DB-LIBRARY error:
>         Data conversion resulted in overflow
> Operating-system error:
>         Error 0
> ---
> 
> 
> Apparently I can't write a literal float with more than four
> characters. Furthermore, I can't write any decimals without a column
> alias (fourth query above).

Hmm, that shouldn't happen.  DB-Library shouldn't connect using a
version of the TDS protocol that might return datatypes it can't
interpret.  (I doubt the alias matters, btw.)  

It's fine to connect with a version older than the latest one
supported by the server.  If you connect, say, with TDS 4.2 to a
modern SQL Server and select a BIGINT, the server will return it on
the wire as a VARCHAR.  What appears to be happening here is
different: fisql appears to be connecting with TDS 7.something, and is
then flummoxed by the returned type.  Or there's a bug in fisql in how
it binds/converts.  

Try this:

	$ export TDSDUMP=./dump
	$ fisql ....
	$ less dump

and look for two things:

1.  Near the top of the file, it will say what version of the TDS
protocol is being used for the connection.  

2.  Near the bottom of the file, it will say what conversion was
requested and failed.  

That should shed some light.  

--jkl
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.