wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

It's not possible to distinguish between float (e.g. DOUBLE) and fixed (e.g. DECIMAL) point fields. #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The function ibm_db_field_type is treating float (e.g. DOUBLE) and fixed 
(e.g. DECIMAL) point fields the same:

switch (stmt_res->column_info[col].type) {
...
        case SQL_REAL:
        case SQL_FLOAT:
        case SQL_DOUBLE:
        case SQL_DECIMAL:
        case SQL_NUMERIC:
        case SQL_DECFLOAT:
            str_val = "real";
            break;
...
}

So it is not possible to treat fixed point fields different from float 
point fields. This would be necessary if e.g. DECIMAL fields should be 
converted to a Python decimal.Decimal object and DOUBLE fields to a Python 
float.

Original issue reported on code.google.com by KunoOspa...@googlemail.com on 18 Aug 2009 at 8:06

GoogleCodeExporter commented 9 years ago
Correct!! We are aware of this issue. Indeed Decimal fields must be converted 
to Python 
decimal.Decimal Objects. 

We would try and get this into next release of the driver. Would intimate you 
about 
this. Thanks for reporting this!!

Original comment by tarun.pa...@in.ibm.com on 20 Aug 2009 at 5:53

GoogleCodeExporter commented 9 years ago
Thank you for your quick response! Is there any progress on this issue yet?

As the decimal module is implemented in plain Python it's a little bit more 
difficult to create instances from a C module. I've done excatly that before 
(creating instances of decimal.Decimal from C), so please let me know if I 
could 
help you.

Best regards,
Kuno Ospald

Original comment by KunoOspa...@googlemail.com on 22 Sep 2009 at 3:58

GoogleCodeExporter commented 9 years ago
Kuno

We have still not taken up this issue since there were higher priority things 
we were 
working on. Because of lack of bandwidth we have not been able to prioritize 
this 
yet. We would love to accept patches/contributions for the driver/wrapper. 

Its just a simple process and does not involve any complications. You need to 
sign a 
Copyright License Agreement(CLA) with us and then upload the code on this 
ticket. 
http://code.google.com/p/ibm-db/wiki/Contributions

Please fill in the form, sign and send me the scanned copy of the document. 
Then we 
can take it from there. 

Thanks and Regards
Tarun Pasrija

Original comment by tarun.pa...@in.ibm.com on 23 Sep 2009 at 7:21

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 10 Nov 2009 at 11:54

GoogleCodeExporter commented 9 years ago
fixed in ibm_db-1.0.1

Original comment by rahul.pr...@in.ibm.com on 27 Mar 2010 at 8:48