Solution for "Cannot insert NULL value for component_event_id field"

While creating tables for wM 7.1, I ran into a problem which stated that NULL value is being inserted in to component_event.component_event_id column.

To remove this problem, place the attached file in “<WM_HOME>\common\db\scripts\oracle\componenttracker\20\create” folder.

The solution is to remove NOT NULL constraint on component_event.component_event_id column.

Ohh yes! when you start having issues and at the end you contact support, please let them know the change you did!

Why? because they will ask you to put the NOT NULL back and start investigate what is causing to insert null values, which looks like a problem you face.

Next time I get a unique constrain error, I will go to database and will delete index!!! yeah!

Come on! worst is to share this kind of error prone “home made” fix which will brake environments!

This is a very, very bad idea. The core tables provided by wM should never be modified. Adding indexes is okay, but changing constraints on columns is a really bad action.

I recommend that you restore that column definition to its original state and troubleshoot (possibly with wM support) why/how a null is being inserted when it shouldn’t be.

I regret for posting a misleading and inappropriate solution. I believe I got this error due to index for component_event_id column and/or CMPNNTVNT_RBI trigger (for adding value to the component_event_id field before insert) on the component_event table were not created properly. I do not know much about Oracle, but one problem which I faced was related to tablespace extent not being available. The auto-extent option was not ‘ON’ and I could not create some components until I changed tablespace settings for auto-extent creation. Not sure, if this has in anyway contributed to the problem.

I have the options of dropping all tables, related indexes and constraints and create them again. So, I proceeded with it. I had manually dropped component_event table, its index and constraints as they are not dropped through “DB Component Configurator” even if we select ALL for component field. The creation of tables for all components was successfully done this time.

I also request the Administrator to delete this thread, as it is misleading.

Thanks DevNull43 and reamon for sharing your views on this.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.