AnsweredAssumed Answered

Getting File Geodatabase float fields into ArcSDE database float field

Question asked by MollyKFoley on Feb 14, 2018
Latest reply on Feb 16, 2018 by jhead@lakeworth

I'm having a lot of trouble with this and can't seem to figure it out. Ideally, I would like my ArcSDE database float field to have a precision of 3 and a scale of 2, but when I transfer values from a file geodatabase using an insert cursor, it only transfers some of the values and I'm trying to figure out why it's only choosing to transfer some values. Maybe someone can shed some light for me..

 

I know file geodatabases don't have precision/scale and instead just hold binary type fields. So there can be a lot of decimal places and I see this in some of my values (i.e. 1.47999921 or something like that). 

 

What happens when your value has a smaller scale than the field it is being transferred to? I thought that if the scale of the destination database was larger than what is being inserted, it would just put the whole number in and append a zero to the end. So if I had 44.1 as a number to be inserted, it would insert 44.10 if the scale of the destination field was 2.

 

If the scale of the destination database is smaller than what is being inserted, it will truncate the value and insert it.

 

I have roughly 10 float fields. Most of them have values that only have one decimal place, but any field has the potential to have a value with multiple decimal places as some values are calculated dynamically in the script. When I set my precision to 3 and my scale to 1, all records are inserted. When I set my precision to 3 and my scale to 2, only about half the records are inserted. Is this because many of the records only have values with one decimal place, meaning scale cannot actually "scale up"? If this is the case, then you must programmatically add a 0 at the hundredths place in the decimal if you want to maintain a scale of 2 in the destination SDE database, right?

Outcomes