Hi All,

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
parameter 1."

- 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
attribute violation:
Cannot convert 350000000000000000000000000000000000000 to a float(4)
(column Field_1)"

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

SQLBindParameter(StmtHandle, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_REAL,
colSize, 0, &InputParam, buffLen,
&Indicator);

My question: is this an ODBC driver problem and, if so, is there any
workaround ?

Thank you,