adetalabi (AT) hotmail (DOT) com (ade talabi) wrote in message news:<bacaae2.0312100442.4f7d72aa (AT) posting (DOT) google.com>...
Quote:
I have just migrated from Sybase 11, to 12.
A piece of code
(select date from OPQ where STR(v) like '%NaN')
that use to work before, converting a varbinary to string now fails
with the following error...
1 1 Number (245) Severity (16) State (1) Server (Jounl001) Domain
error during implicit convesion of VARBINARY value '.yyyy' to a FLOAT
field.
Any solutions? |
The values "Inf" and "NaN", while valid under the floating point
standard, are not allowed in SQL, although older versions of
ASE allowed them to be inserted in error. In particular CR 271561
implemented in 12.5.0.3 and above a low-level check to prevent such
values from being inserted in ASE. However, there may still be legacy
data in a database with such values in it. Traceflag 4067 turns off
the check, but my advice would be to go through your data and scrub
it of such values.
Here is an approach to find both "Inf" and "Nan" values in floating
point columns on big-endian systems:
Code to find invalid REAL values:
select realcolumn from mytable where
convert(int,convert(binary(8),realcolumn) & convert(int,0x7f80) =
convert(int,0x7f80)
Code to find invalid DOUBLE PRECISION values:
select floatcolumn from mytable where
convert(int,convert(binary(8),floatcolumn) & convert(int,0x7ff0) =
convert(int,0x7ff0)