Error with query tag string

hello everyone

I have a Query Tag Type string, and I need used in Dropdown List, but I have the next error

Please limit your post tags to the platform you are using.

In your tag browser, I see a value, and not something that says it’s a dataset. I’m guessing your tag is set as a string.

2 Likes

Yes, it’s a TAG query of type STRING

Yes, but you’re trying to bind it to a dataset. That is not going to work. Try changing the tag datatype to dataset.

that’s it, thank you very much now just a question how can I read it?

I am doing it in the following way but it gives me an error

Type = system.tag.read (“Type_Stop”). Value.getValueAt (0, ‘Type’)

Do you mean from the dropdown? Use the selectedLabel property

I want to save the selected data from the list

I have the following error

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File “”, line 19, in valueChanged at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:362) at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:258) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO PAROS (Linea, Maquina, TipoParo, TiempoParo, Fecha) VALUES (?, ?, ?, ?, ?), [Disco, Disco, Dataset [11R ? 2C], 00:01:00, Wed Apr 28 13:24:02 CDT 2021], TOPY_MW, , false, false)

at org.python.core.Py.JavaError(Py.java:495)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:362)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:258)

at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:186)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.call(ScriptManager.java:431)

at org.python.core.PyObject.call(PyObject.java:422)

at org.python.core.PyObject.call(PyObject.java:426)

at org.python.pycode._pyx8490768.valueChanged$1(:19)

at org.python.pycode._pyx8490768.call_function()

at org.python.core.PyTableCode.call(PyTableCode.java:165)

at org.python.core.PyBaseCode.call(PyBaseCode.java:301)

at org.python.core.PyFunction.function___call__(PyFunction.java:376)

at org.python.core.PyFunction.call(PyFunction.java:371)

at org.python.core.PyFunction.call(PyFunction.java:361)

at org.python.core.PyFunction.call(PyFunction.java:356)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:649)

at com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager$FunctionInvokerImpl.run(TagScriptManager.java:493)

at com.inductiveautomation.ignition.common.sqltags.scripts.AbstractTagScript.invoke(AbstractTagScript.java:33)

at com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager$Task.invoke(TagScriptManager.java:442)

at com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager$TagScriptDispatcher.run(TagScriptManager.java:405)

at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:518)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: org.python.core.PyException: Traceback (most recent call last): File “”, line 19, in valueChanged at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:362) at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:258) at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO PAROS (Linea, Maquina, TipoParo, TiempoParo, Fecha) VALUES (?, ?, ?, ?, ?), [Disco, Disco, Dataset [11R ? 2C], 00:01:00, Wed Apr 28 13:24:02 CDT 2021], TOPY_MW, , false, false)

… 31 common frames omitted

Caused by: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO PAROS (Linea, Maquina, TipoParo, TiempoParo, Fecha) VALUES (?, ?, ?, ?, ?), [Disco, Disco, Dataset [11R ⅹ 2C], 00:01:00, Wed Apr 28 13:24:02 CDT 2021], TOPY_MW, , false, false)

… 30 common frames omitted

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to UNKNOWN is unsupported.

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170)

at com.microsoft.sqlserver.jdbc.DataTypes.throwConversionError(DataTypes.java:946)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:958)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObjectNoType(SQLServerPreparedStatement.java:910)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:919)

at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:166)

at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRPreparedStatement.setObject(SRConnectionWrapper.java:1055)

at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper.runPrepUpdate(SRConnectionWrapper.java:178)

at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities._runPrepStmt(GatewayDBUtilities.java:132)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:256)

… 28 common frames omitted

You can't supply a Dataset as a parameter, SQL doesn't understand what to do with it.

You'll need to loop through the selected items and run an update for each row.

I think we need to back up a bit and detail what you are trying to do.

I want to save the selected information from the Dropdown List

in the database

I already made it, thank you very much.

I removed them all from his other post :confused: