Unanswered: Sybase IQ: inserting REAL overflowed value using ODBC
I have a problem when trying to insert an overflowed REAL value using ODBC
for Adaptive Server IQ 12
(driver version: 7.00.02.1480) on a W2K platform, as follows:
- I use a parameterized INSERT statement, e.g.:
INSERT INTO TabReal VALUES(?)
where TabReal has only one column of type REAL.
- I follow the normal steps, i.e. allocate, prepare, bind parameter and
execute. The value for the parameter is some
overflowed value (e.g. 3.5e38). The problem is that, instead of getting an
error message, the ODBC driver says
nothing and executes the statement successfully. When trying to view the
inserted data I get the following error message:
"Restricted data type attribute violation: Cannot convert ??? to a ???
(State:07006, Native Code: FFFFFF63)"
- it is my understanding that the ODBC driver silently inserts some
"corrupted" value instead of reporting back the overflow.
- I have used the same code against Adaptive Server Enterprise 12 and it
works fine, i.e. I get the following error message:
"22003 [ODBC Sybase ASE driver]Numeric value out of range. Error in
- if I use a non-parameterized INSERT statement, e.g.:
INSERT INTO TabReal (Field_1) VALUES (3.5e38)
it works fine, i.e. I get the following error message:
"07006 [Sybase][ODBC Driver][Adaptive Server IQ]Restricted data type
Cannot convert 350000000000000000000000000000000000000 to a float(4)
- Note: I use a character string as a host variable to represent the REAL
value, i.e. SQL_C_CHAR is used as C type within SQLBindParameter(), e.g.: