laptop and a wrench

Bug

Geodatabase passing attribute NULL values when attribute is not referenced. Ramification is the DBMS cannot set attribute default values.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM008852
SubmittedMay 14, 2007
Last ModifiedApril 28, 2025
Applies toNo Product Found
Version found9.2
StatusWill Not Be Addressed

Description

If a database management system (DBMS) attribute contains a default value it does not set because the geodatabase sets the attribute to NULL when performing an insert.

Working with non-versioned classes, a default value for a table's attribute may be defined. When an application inserts a row into the table and the attribute is not referenced in the INSERT statement, the database automatically sets the value of the attribute to the default value.

Since the geodatabase is an object-oriented application, all values are initialized when objects (rows) are created. Attributes that are nullable are set as NULL. Attributes that are not nullable receive initial values so as not to violate the NOT NULL constraint when the row is inserted into the table.

Note:
Varchar values are defined as an empty string and integer values are defined as 0.

Cause

When the geodatabase sets a NULL value for nullable attributes, the DBMS expects the attribute value to be NULL and therefore does not set the value to the attribute's default value.

Workaround

Create a trigger on the attribute table to set a value other than NULL during an insert.

The following is an Oracle example for creating a BEFORE INSERT trigger that sets an attribute value during an insert operation:
Code:
CREATE OR REPLACE TRIGGER before_insert_parcels
BEFORE INSERT ON parcels FOR EACH ROW

BEGIN

IF :NEW.appraisal_value IS NULL THEN
:NEW.appraisal_value := 0;
END IF;

END;
/


After a row is inserted into the parcels table and the appraisal_value is NULL, the trigger sets the appraisal_value to 0 prior to performing the INSERT into the table.

    Steps to Reproduce

    Bug ID: NIM008852

    Software:

    • No Product Found

    Get notified when the status of a bug changes

    Download the Esri Support App

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options