Error when inserting null in auto-generated historian table (oracle 12.2c)

Hello, I am using oracle 12.2c and I encounter this problem in my historian.I cant figure out how to fix this error because this is an auto-generated table please help
thank you

java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("TESTDB"."SQLTH_DRV"."id")

The error is saying you are trying to insert null into a column that is either a primary key or has been explicitly marked as not null. In this case, ‘id’ is the primary key of the table.

but the tables are auto-generated and these are historian tables and alarm events. Should I modify the tables? if I do so it gives me an error of Invalid conversion error. I updated my ojdbc driver to 8 since I am using oracle 12cr2

I guess we need more information – are you trying to manually insert data (either outside of Ignition or through scripting in Ignition), or are you encountering this when Ignition is trying to store tag history? I assumed the former from your first question.

I encountered this when ignition tries to store alarm events data and tags history to the database. ignition tries to insert null value to the id column which always gives an error of ORA-1400

That column should have default that retrieves the next sequence. Sounds like that didn’t get set up correctly.

Just to inform that I have the same problem here using Oracle 21c and Ignition 8.1.16

Solved here, the user I created did not had permission to create sequences, thus, the table wasn’t able to accept null for the column ID!

After giving the permission I suggest deleting all stuff (tables and sequences) you have and create the connection again so Ignition can rebuild the database correctly.

1 Like