Re: insert infinity value as float Hello,
I think newer versions disallow nan and inf for the most part.
Here is a note from one of the bugs that were fixed that now disallow
these non-numbers:
================================================== ======================
ASE does not allow the insertion of floating point values "NaN" and
"Inf" through straightforward
language methods, but does allow such values to be inserted through
other means. The behavior
should be consistant, either always allowing such values or never
allowing them. The current
inconsistant behavior causes terrible problems to replication
environments, as clients can insert
Nan values and repserver will try to replicate them, but does so by
generating TSQL language which
is rejected by the destination server, causing the replication system
to fail.
================================================== ======================
I found fixes in both the client utilities and in ASE that attempt to
prevent users from entering them:
231344 - CTBCP: native mode bcp now can prevent insertion of floating
point NaN and InF values.
Fixed in: 12.0 ESD#13, 12.5 ESD#6 and higher
271561 - Implement strong data type checking for floating-point values
of "NaN" and "Inf".
Disable using -T4067 at boottime.
Fixed in: 12.5.0.3 or higher
So if you REALLY want to try and insert them into 15.0.x, you could
try booting ASE with -T4067
and use the older version of bcp.
However, I would really discourage doing so as it might end up causing
more problems once you
force them into ASE. I would recommend running a query similar to
this to find the invalid FLOAT
values and then correct them once you find them:
select floatcolumn from mytable where
convert(int,convert(binary(8),floatcolumn) & convert(int,0x7ff0) =
convert(int,0x7ff0)
Thanks,
Neal |