# Request for Assistance with master named SQL Query Parameters

**URL:** <https://forum.inductiveautomation.com/t/request-for-assistance-with-master-named-sql-query-parameters/93606>\
**Category:** Ignition\
**Tags:** namedqueries\
**Created:** [July 23, 2024, 2:55pm UTC](https://forum.inductiveautomation.com/t/request-for-assistance-with-master-named-sql-query-parameters/93606 "2024-07-23T14:55:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajashekar\_Reddy](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Rajashekar\_Reddy](https://forum.inductiveautomation.com/u/Rajashekar_Reddy)\
**Post date:** [July 23, 2024, 2:55pm UTC](https://forum.inductiveautomation.com/t/request-for-assistance-with-master-named-sql-query-parameters/93606/1 "2024-07-23T14:55:52Z")

</div>

HI,

I am currently working on a project that requires the extraction of data from various SQL tables using a master named query. The challenge I am facing involves dynamically changing the table name for each execution, along with passing parameters for the From date (FD) and To date (TD). However, I have encountered an error stating that the string has a maximum length of 128 characters Please find the attached photos for your information.

Could you please provide guidance on implementing this solution or suggest an alternative method that accommodates the dynamic nature of the table names and date parameters? Your expertise in this matter would be greatly appreciated.

Thank you for your time and assistance.

 ![named_query_error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fcdaeacda5a0f5409b1d79f1e382ed4762ff150e.jpeg)  
 ![Named Master Query](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/3/0397490243924a9af6eacfbeb5fe3e1d923e52d1.jpeg)

Best regards,  
B.R.Reddy

---

<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:** [July 23, 2024, 3:02pm UTC](https://forum.inductiveautomation.com/t/request-for-assistance-with-master-named-sql-query-parameters/93606/2 "2024-07-23T15:02:27Z")

</div>

First, that's not a SQL **query** , it is a SQL **script**. Vanilla JDBC doesn't support that, and support in specific JDBC drivers is spotty.

Value parameters can only be injected where the JDBC driver can parse the given SQL (not a string parameter containing SQL) to identify a valid place for a substitution **value**.

Please describe your the fundamental requirement you are trying to achieve--not the "requirement" to use a single named query. Sounds like an XY problem.

Please also post your SQL as actual text (not a screenshot, and never a photo), using this forum's "preformatted text" button, so we can cut and paste into our replies.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 23, 2024, 3:08pm UTC](https://forum.inductiveautomation.com/t/request-for-assistance-with-master-named-sql-query-parameters/93606/3 "2024-07-23T15:08:19Z")

</div>

@pturmel is correct and make sure you really need to do what you're trying to do. There may be a better or easier way to achieve your end goal. IF the only way to go about it is with a dynamic table name, you'll probably need to create a stored procedure in the database and call that procedure from Ignition.
