4

I'm appending data in my script and some of the source data has nulls in fields that are required. The script runs successfully but those features do not get appended.

When I run the tool in ArcMap, I get

warning 000596 - "This warning will occur when attempting to add a value to a field that is inappropriate for that value. For instance a text with a width of 10 cannot be merged into a field that has a width of 5... This warning will also result from adding a null value to a field that does not support null values."

The offered solution is

"When dealing with nulls, the Preserve Nulls environment can be turned on or off to control whether nulls are preserved in the output. If turned off, the tool used will attempt to add null values to a field or format that will not accept them."

I cannot find the Preserve Nulls environment setting.

This is the link to the warning: http://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-00576-00600-000596.htm

I am on version 10.3.1

The reason I want to preserve the nulls (and keep the field non-nullable) is that this data will be edited in Collector and I want the user to be forced to correct the error when they edit that feature. The alternative I may pursue is to put a value in the fields that is outside of the domain, which will also force the user to correct the data in Collector, however I'm short on time and there are a lot of fields I will need to do this for. That is why the Preserve Nulls setting appealed to me.

closed as off-topic by PolyGeo Feb 4 '18 at 11:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • You are essentially looking to corrupt the database, then fix it later. Most databases won't permit that. You could define a new table without NOT NULL columns and load into that, but then you're obligated to repair the data on your own. – Vince Jan 8 '18 at 18:05
1

I believe that the help is referring to the field mapping property Allow NULL values. You can access this property by right-clicking on a field in the field mappings window and clicking on Properties.... However, this variable cannot be changed when using the Append tool, since doing so would mean you are trying to change the attributes of an existing feature class.

enter image description here

A Merge, on the other hand, allows for this property to be set, since a new feature class is being created.

enter image description here

I believe your best solution is to update these fields with a value representing Null (-9999 or whatever may be appropriate), prior to your merge. A python script could accomplish this task quickly if you have the knowledge base.

Not the answer you're looking for? Browse other questions tagged or ask your own question.