Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Python-Aprium, Python-8.4.1 p1
-
Component/s: Python Driver
-
Labels:None
-
Environment:
Any
Description
Here is the test code for creating the database and the python code:
CREATE TABLE "tst2"( "a" NUMERIC(38,12) ); INSERT INTO tst2 values (5.3);
import CUBRIDdb
conn = CUBRIDdb.connect('CUBRID:localhost:30000:demodb', 'dba', '')
cur = conn.cursor()
cur.execute("SELECT * from tst2");
row = cur.fetchone()
print type(row[0])
cur.close()
The type returned for the NUMERIC field is (type 'float') which is incorrect. It should be returned as decimal.Decimal object.

There is Decimal module in Python, convert numeric type of CUBRID to decimal type in Python.