# Use named query parameter as db table column name to be updated

**URL:** <https://forum.inductiveautomation.com/t/use-named-query-parameter-as-db-table-column-name-to-be-updated/91778>\
**Category:** Ignition\
**Tags:** namedqueries, ignition81\
**Created:** [June 12, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/use-named-query-parameter-as-db-table-column-name-to-be-updated/91778 "2024-06-12T20:16:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Calderon](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Daniel\_Calderon](https://forum.inductiveautomation.com/u/Daniel_Calderon)\
**Post date:** [June 12, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/use-named-query-parameter-as-db-table-column-name-to-be-updated/91778/1 "2024-06-12T20:16:46Z")

</div>

Hi,

I am trying to use a named query to update a value in one of four columns in a MySQL database table. However it looks like if I use a string parameter to tell the query the field to update it doesn't work. The value parameter works fine.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d06dc9c10fd2ab478d585068dff051372ab5d80a.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/232316830ce20432b8b976bfc99996fdfb4bffcc.png)

Is this possible at all?

Did not find this case in any of the other topics...

Thanks.

edited typo

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [June 12, 2024, 8:20pm UTC](https://forum.inductiveautomation.com/t/use-named-query-parameter-as-db-table-column-name-to-be-updated/91778/2 "2024-06-12T20:20:02Z")

</div>

Change `Type` from `Value` to `QueryString` and re-drag the parameter into the query. Be careful as the inputs are not sanitized

> **[Named Query Parameters | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/sql-in-ignition/named-queries/named-query-parameters#querystring)**
>
> Parameters allow you to make Named Queries dynamic. They act as placeholders you can pass values into when requesting the query to execute. Other resources in Ignition can then pass arguments into the parameters. The exact implementation depends on...

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [June 12, 2024, 8:21pm UTC](https://forum.inductiveautomation.com/t/use-named-query-parameter-as-db-table-column-name-to-be-updated/91778/3 "2024-06-12T20:21:49Z")

</div>

Use type QueryString:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/5/e546b4c21ad025ef41659e7eff67d300097497af.png)  
Then:

```python
SET
        {entryName} = :entryValue

```

...but beware of SQL injection--don't do it if entryName is generated by user input!

---

<div class="post-metadata">

**Author:** ![Daniel\_Calderon](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Daniel\_Calderon](https://forum.inductiveautomation.com/u/Daniel_Calderon)\
**Post date:** [June 12, 2024, 8:29pm UTC](https://forum.inductiveautomation.com/t/use-named-query-parameter-as-db-table-column-name-to-be-updated/91778/4 "2024-06-12T20:29:13Z")

</div>

Thank you so much! Don't know why I looked at forum first. Thanks for the time. D
