Error query missing

Hi, I have an issue when I make a update query from ignition. I’ve checked the table and the change is realized, but always I get the following error:

12:29:56.712 [UpdateExecuter 2] ERROR com.inductiveautomation.factorypmi.application.gateway.QueryManager - Error running update query:
""@-1ms
On: aceitado2.Root Container.tb_calibres.data
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: SQL error for “”: Query missing.

The query is:

tabla = event.source
datos = event.source.data
fila = event.source.selectedRow
if fila >= 0:
	columna = event.source.selectedColumn
	columnas = system.dataset.getColumnHeaders(datos)
	ndx = datos.getValueAt(fila,'NDX')
	parametro = columnas[columna]
	valor = datos.getValueAt(fila,parametro)
	query = "UPDATE PARAMETROS_LINEA_ACEITADO SET %s = %s WHERE NDX = %d" % (parametro,valor,ndx)
	txID = system.db.beginTransaction(database = "main",timeout = 5000)
	system.db.runUpdateQuery(query,"main",txID)
	system.db.commitTransaction(txID)
	system.db.closeTransaction(txID)
	system.db.refresh(tabla,'data')

I put some print between the system.db.runUpdate and system.db.commitTransaction, but the error is printed after the system.db.refresh(tabla,‘data’). So, I created a button that execute the last line, but there is no error when I clicked.

What would be the problem?

Does your table have a query binding to the data property? If not, system.db.refresh wouldn’t have anything to refresh, maybe?

Wladimir, please use the </> code formatting button. Don’t post code as a bullet list! There is an edit button (pencil icon) below your post so you can fix it.

1 Like

I have a binding query in the table, with a button that execute the system.db.refresh it works.

I made some tests. That is the result:

QueryManager - Error running update query: ""@-1ms
On: aceitado2.Root Container.tb_calibres.data com.inductiveautomation.ignition.client.gateway_interface.GatewayException: SQL error for "": Query missing.

The table is binding with a SQL Query and polling mode is off. In another table I can make changes the first time, but when I tried to modify a columm twice times, I get that error:

Traceback (most recent call last):

  File "<event:cellEdited>", line 11, in <module>



java.lang.Exception: java.lang.Exception: Error executing system.db.beginTransaction(main, 2, 5000)


	caused by Exception: Error executing system.db.beginTransaction(main, 2, 5000)
	caused by GatewayException: ORA-01453: SET TRANSACTION must be first statement of transaction

	caused by SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction

Any suggestion?