# Passing string variable to Stored Procedure - Too Long Error

**URL:** <https://forum.inductiveautomation.com/t/passing-string-variable-to-stored-procedure-too-long-error/5237>\
**Category:** Ignition\
**Created:** [October 4, 2012, 10:26am UTC](https://forum.inductiveautomation.com/t/passing-string-variable-to-stored-procedure-too-long-error/5237 "2012-10-04T10:26:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [October 4, 2012, 10:26am UTC](https://forum.inductiveautomation.com/t/passing-string-variable-to-stored-procedure-too-long-error/5237/1 "2012-10-04T10:26:43Z")

</div>

Inductive Team,

We had a Table, Multiple (16) text fields for filtering the data. We are fetching data using Stored Procedure (takes WHERE clause as Parameter (Type: varchar(2000)) \> Building prepared statement by attaching WHERE clause \> running prepared statement and return result-set).

We are building WHERE clause depending on filtering text fields. We are making sure there will be no statement if text fields are not entered. Our query will become big once you enter in more than 6 or 7 text fields. After this, we passed this WHERE clause and struck with … is too long. Maximum length is 128 error (screenshot attached). When we run in SQL Server with long WHERE clause, it works correctly.

Is there any setting we need to make for Ignition ?  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/047d716a35937d14c53da0fef28787b013f52d96.png)

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [October 4, 2012, 3:31pm UTC](https://forum.inductiveautomation.com/t/passing-string-variable-to-stored-procedure-too-long-error/5237/2 "2012-10-04T15:31:57Z")

</div>

That error usually means that SQL is interpreting something in double quotes as being an identifier (i.e., column name). Do you have something in your SELECT query in the stored procedure that is using double quotes?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 4, 2012, 3:48pm UTC](https://forum.inductiveautomation.com/t/passing-string-variable-to-stored-procedure-too-long-error/5237/3 "2012-10-04T15:48:47Z")

</div>

Can you post the query and the code you use to run the query?

---

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [October 5, 2012, 6:05pm UTC](https://forum.inductiveautomation.com/t/passing-string-variable-to-stored-procedure-too-long-error/5237/4 "2012-10-05T18:05:29Z")

</div>

James,

You are absolutely correct. We are using double quotes for passing parameter to Stored Procedure. Now, we rectified our mistake and it works now.

Thank you Team.
