bveldkamp

Write floating point value to SDE/PostGIS

Discussion created by bveldkamp on Nov 11, 2011
Latest reply on May 25, 2012 by antonio.sergioesri-portugal-pt-esridist
Hi,

I'm trying to insert a new row into an SDE/PostGIS database, using Python. The field is defined as numeric(38,8) in PostgreSQL, and as double in ArcCatalog. The decimal symbol in windows' language settings is set to '.'

Here's some sample code:
featureClass = "Database Connections\Connection to sde\sde.schema.featureclass"
rows = arcpy.InsertCursor(featureClass)
row = rows.newRow() 
row.value = 1.88
rows.insertRow(row)
This results in a value '1' in the table. I also tried float(1.88) and '1.88' but these also result in 1. Setting the value to '1,88' results in 188.

How can I solve this?

Best regards,
Berend Veldkamp

Outcomes