After I change the precision and scale for my short, long, float, and double field types when creating a table in ArcMap SDE geodatabase, ArcMap will reset my precision and scale to default values. For instance, I wanted my short integer to have a precision of 3 in one table and 2 in the other so I could test some python code. ArcMap changed them both to precision of 5 automatically and the python tool isn't given a proper test.
Please note that this is a different but related issue that was addressed here: Specifying precision and scale of new field using ArcPy? I know how to specify the precision, but ArcMap isn't keeping my settings.
If this makes sense stop reading here. If you want more detail, please continue reading:
I am creating an enterprise geodatabase in ArcMap 10.2.1 for the purpose of testing two tables: a source table and a destination table. I am building a tool that will describe the tables, put the field names as keys in a dictionary and the field objects as values, populate a list of all matching fields, then a series of if statements remove the fields that may have the same name, but incompatible data types, precisions, scales, and field lengths. Incompatible is different than non-matching. I created if statements that allow a short integer in a source table to be compatible with a long integer(or a float, or a double) in a destination table. But this cannot be reversed. Only a short can go into a short. But if they have different precisions, a smaller or equal precision can go into a larger precision, but a larger precision cannot go into a smaller one.
This is why I need ArcMap to keep my varying precision values across different fields. I need to be able to test every possibility.
# Pass SmallInteger types if going into a SmallInteger. if source_type == 'SmallInteger' and destination_type == 'SmallInteger': pass # Filter out incompatible precision. if source_precision <= destination_precision: pass if source_precision > destination_precision: matched_column_list.remove(name_1.lower()) continue
That is my issue. If anyone can get my enterprise geodatabase to behave, please let me know!
I'm using ArcGIS 10.2.1.