Issue
The following error messages are displayed in the Application Director output windows when attempting to add additional histories to a existing SQL database.
javax.baja.sys.BajaRuntimeException
at javax.baja.rdb.history.BRdbmsHistoryExport.insertMetaRecord(BRdbmsHistoryExport.java:679)
at javax.baja.rdb.history.BRdbmsHistoryExport.exportRecords(BRdbmsHistoryExport.java:279)
at javax.baja.rdb.history.BRdbmsHistoryExport.doExecute(BRdbmsHistoryExport.java:202)
at auto.com_tridium_rdb_sqlserver_history_BSqlServerHistoryExport.invoke(AutoGenerated)
at com.tridium.sys.schema.ComponentSlotMap.invoke(ComponentSlotMap.java:1232)
at com.tridium.sys.engine.EngineUtil.doInvoke(EngineUtil.java:49)
at javax.baja.sys.BComponent.doInvoke(BComponent.java:1050)
at javax.baja.util.Invocation.run(Invocation.java:46)
at javax.baja.util.ThreadPoolWorker$WorkerThread.run(ThreadPoolWorker.java:266)
Caused by: java.sql.BatchUpdateException: Invalid column name 'INTERVAL_'.
at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:944)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at javax.baja.rdb.history.BRdbmsHistoryExport.insertMetaRecord(BRdbmsHistoryExport.java:673)
... 8 more
Environment
G3 Niagara, 3.4 and later, SQL
Cause
The term INTERVAL was a keyword in some SQL dialects, so the column name was changed from INTERVAL to INTERVAL_ in the database schema. The database schema changed between 3.3 and 3.4.
Resolution
The following changes needed to be made to the SQL database.
- Altered the existing HISTORY_CONFIG table in the SQL database to change the column to INTERVAL_.
- Altered the HISTORY_CONFIG table, added a column called SYSTEMTAGS, set up as VARCHAR(500).
-
Changed SOURCE column length to VARCHAR(500) in the HISTORY_CONFIG table