# Perspective dynamic table name query

**URL:** <https://forum.inductiveautomation.com/t/perspective-dynamic-table-name-query/44203>\
**Category:** Ignition\
**Created:** [March 7, 2021, 10:01pm UTC](https://forum.inductiveautomation.com/t/perspective-dynamic-table-name-query/44203 "2021-03-07T22:01:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [March 7, 2021, 10:01pm UTC](https://forum.inductiveautomation.com/t/perspective-dynamic-table-name-query/44203/1 "2021-03-07T22:01:56Z")

</div>

I have a component in a view that I mean to duplicate for each machine name which have their own corresponding tables.  
I have a specific machine named query:  
SELECT passfail FROM BootAssemblyGS158 WHERE barcode = :barcode  
But I cannot bind a property value to differing named queries, that I know of so I made a more generic named query:

 ![namedquery](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/6/06305f8386b0788775d7a9173eb43fe9bebb4ae8.png)

This one, however, does always returns the fallback value. So I am thinking that variable table names is not a workable idea here unless I am missing something in the code.  
How should I go about binding components in views to different tables depending on the indirection needed?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 7, 2021, 10:17pm UTC](https://forum.inductiveautomation.com/t/perspective-dynamic-table-name-query/44203/2 "2021-03-07T22:17:49Z")

</div>

Table names and column names and schema names are not data, as far as JDBC is concerned, and therefore cannot be delivered by a _Value_ parameter. In exactly the same way and for exactly the same reason that you cannot use ‘?’ parameters for them in scripted .\*Prep\* queries. You must use a _QueryString_ parameter instead, with curly brace substitution.

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [March 8, 2021, 1:40am UTC](https://forum.inductiveautomation.com/t/perspective-dynamic-table-name-query/44203/3 "2021-03-08T01:40:20Z")

</div>

Thank you Phil.
