471,872 Members | 1,093 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,872 software developers and data experts.

How to use SQLBindParameter for double or float datatype


I have a problem using SQLBindParameter for columns of datatype DOUBLE
or REAL.

e.g. I have an insert statement where i wan't to insert the value 100.10
into a DOUBLE column.
For the source type of SQLBindParameter I need to use SQL_C_CHAR.
What type does I need to set ParameterType, I have tried SQL_VARCHAR and
SQL_DOUBLE with the same result:

If the value uses ',' as decimal separator everything works fine, but
when I use '.' as decimal separator I get the error
[IBM][CLI Driver] CLI0112E Zuordnungsfehler. SQLSTATE=22005

In case of a DECIMAL column, I think the driver works correctly, because
after calling SQLExecDirect the buffer for the value has changed from
e.g. '10,02' to '10.02' so for this type i can use both decimal separators.

But I need to use '.' as decimal separator for DOUBLE and REAL columns.

How can I do this?

Nov 12 '05 #1
0 2385

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bj?rn Terje Svennes | last post: by
4 posts views Thread by Michael Mair | last post: by
8 posts views Thread by abdul_n_khan | last post: by
60 posts views Thread by Erick-> | last post: by
reply views Thread by Terry Reedy | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.