# Error with query tag string

**URL:** <https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [April 28, 2021, 2:55pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121 "2021-04-28T14:55:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 2:55pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/1 "2021-04-28T14:55:04Z")

</div>

hello everyone

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

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/961944882dada59e06344d22287af763bcb3e0f5.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 28, 2021, 3:03pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/2 "2021-04-28T15:03:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 3:14pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/3 "2021-04-28T15:14:21Z")

</div>

Yes, it’s a TAG query of type STRING

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 28, 2021, 3:18pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/4 "2021-04-28T15:18:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 5:25pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/5 "2021-04-28T17:25:19Z")

</div>

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’)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 28, 2021, 6:12pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/6 "2021-04-28T18:12:25Z")

</div>

Do you mean from the dropdown? Use the selectedLabel property

---

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/7 "2021-04-28T18:17:45Z")

</div>

I want to save the selected data from the list

---

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 6:31pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/8 "2021-04-28T18:31:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 28, 2021, 6:35pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/9 "2021-04-28T18:35:44Z")

</div>

> [@antonio.sanchez](#):
>
> Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to UNKNOWN is unsupported.

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.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 28, 2021, 6:39pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/10 "2021-04-28T18:39:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 8:41pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/11 "2021-04-28T20:41:51Z")

</div>

> [@antonio.sanchez](#):
>
> Dropdown List

I want to save the selected information from the Dropdown List

in the database

---

<div class="post-metadata">

**Author:** ![antonio.sanchez](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@antonio.sanchez](https://forum.inductiveautomation.com/u/antonio.sanchez)\
**Post date:** [April 28, 2021, 8:56pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/12 "2021-04-28T20:56:00Z")

</div>

I already made it, thank you very much.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 29, 2021, 3:43pm UTC](https://forum.inductiveautomation.com/t/error-with-query-tag-string/46121/13 "2021-04-29T15:43:50Z")

</div>

> [@JordanCClark](#):
>
> Please limit your post tags to the platform you are using

I removed them all from his other post 😕
