# How to correctly pass a flow variable into DB Query Reader's "?" placeholder? (Error: No value specified for parameter 1)

**URL:** <https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845>\
**Category:** KNIME Analytics Platform\
**Tags:** database, feature-request\
**Created:** [April 23, 2026, 10:16am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845 "2026-04-23T10:16:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzkary](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/4da419/32.png) [@zzkary](https://forum.knime.com/u/zzkary)\
**Post date:** [April 23, 2026, 10:16am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/1 "2026-04-23T10:16:04Z")

</div>

### Hi everyone,

I’m having trouble passing a flow variable into the **DB Query Reader** node in KNIME and keep getting the error:

> **No value specified for parameter 1**

### My Setup

1. I have an **Integer Configuration** node (or **Table Row to Variable** ) that creates a flow variable named `question_id`. The value is a valid integer (e.g., `4603462155713052728`).
2. I connected the **red flow variable port** from that node to the DB Query Reader.
3. In the DB Query Reader, my SQL is:

```sql
SELECT
    task_id,
    question_id,
    response_text
FROM
    `my_database`.`my_table`
WHERE
    question_id = ?
    AND response_text <> ''
    AND deleted = 0;

```

### 

**What I’ve Tried**

- I clicked on the **Flow Variables** tab in the DB Query Reader, but I **don’t see “Parameter 1”** listed there. The list only shows global variables like `knime.workspace` and my `question_id`, but no way to map it to the `?`.

- I tried looking for a “Bind” button next to the SQL editor but couldn’t find it.

- When using **Table Row to Variable** , I changed “Include missing values” to “Use default values” to ensure the variable is created.

### **My Question**

1. How do I properly bind the `question_id` flow variable to the `?` placeholder in DB Query Reader?

2. Why doesn’t “Parameter 1” show up in the Flow Variables tab? Is there a step I missed?

3. In the latest KNIME UI, is there a specific button or right-click menu in the SQL editor to map variables?

Thank you so much for any help! I’m using KNIME 5.x with a MySQL database.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/1/b1b821c833204cd4ac919f4ddb646dc83ec70c34.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/a/8/a8880f81280c19ea1a66fae54cd01c87ad22038c.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/3/333a24e40657f5f880040de77fb46430b79ea823.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/2/f2e5679ffdbba5733fb9b9a43ce75013f0d62836.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/6/b6b83704bbffe81a54f8467c91c7789a6e6677eb.png)

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 23, 2026, 6:37pm UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/2 "2026-04-23T18:37:19Z")

</div>

Hi @zzkary , welcome to the KNIME community.

There’s a few things to note here. Firstly, KNIME doesn’t actually make use of bind variables within sql statements. Unfortunately this was never implemented, which is a shame because it can improve performance, makes the inclusion of queries much more standardised and portable, and they secure against sql injection attacks in rogue data. It is a feature that has been requested in the past.

Instead of bind variables, you need to include the flow variable within the actual query using a special KNIME variable placeholder format instead of the `?` positional placeholder

i.e. instead of writing a query such as:  
`select task_id from my_database.my_table `  
`where question_id = ?`

you would write it as:  
`select task_id from my_database.my_table `  
`where question_id = $${Squestion_id}$$`

You can do this easily within the DB Query Reader node, by (1) highlighting the `?` in the SQL Statement text area, and then (2) double-clicking “question\_id” in the Flow Variable List in the centre panel:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/1/91ad984485e4681a88b966941223f25e94ae804c.png)

so it then looks like this:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/2/d2357dec48ec5df88dad0a74663ab32faa8f848d.png)

Of course you can just overtype the `?` with `$${question_id}$$` if you prefer.

**Remove the setting of the sql\_statement to your flow variable on the Flow Variables tab**  
Please also make sure that where you have already set “sql\_statement” to “question\_id” in the Flow Variables tab, that you delete this setting (revert it back so that it is set to blank)

i.e.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/a/9af00eddd803f58d446bc15f264a96cad8e87339.png)

This is because if you set a value for sql\_statement here it replaces the entire sql\_statement with the contents of the specified variable, at execution time, so you would only ever set this to a string variable that contains the entire query.

**Remove the “;”**  
An additional note is that in general, you should not include the “;” at the end of the sql query within the text box, as this can cause problems if it is present, especially if you attempt to use the “Evaluate” button to test the query - although I think that can depend on the database in use. For example, I tried it with postgresSQL in KNIME 5.11 and it was ok, but in the past, with Oracle I’ve seen it can cause an error.

**Parameter 1 not showing?**

You had a specific question about why “parameter 1” doesn’t show up in the list. In the workflow as you show it in your screenshots, I don’t see where “parameter 1” would appear from. The variable “question\_id” is present, presumably because you had a column called question\_id from the Excel sheet, and you have used Table Row to Variable to take the first value of the question\_id column and created a question\_id variable from it. So it is the question\_id variable that is available to you. I hope the above description shows you how you can incorporate the question\_id variable within your query, and explains why it is that the bind-variable `?` format doesn’t work in KNIME.

One final thing I should add, is that with actual bind variables, you would not normally include quotes around strings, e.g. if for example you were trying to include a condition with a string column such as this:  
`where forum_user=?`

A true bind variable would recognise that this was a placeholder for a value and would infer the type of the value being passed.

However, with KNIME, it is simply performing a string concatenation, rather than a binding, so if you were trying to pass a string value, instead of a numeric value, you would also have to include quotes around the variable.

e.g.  
supposing I had a variable “forum\_user” that was set to takbb,

I would have to write the condition as  
`where forum_user = ’$${forum_user}$$’`

At execution time, KNIME would then convert this to

```auto
where forum_user = ’takbb’

```

If I hadn’t included the single quotes in the original query, it would convert this to

```auto
where forum_user = takbb

```

which would then fail because it would not understand what the symbol “takbb” refers to.

I hope that helps 😉

further forum references re bind variables:

> [@Oracle Bind Variables in KNIME](https://forum.knime.com/t/oracle-bind-variables-in-knime/9190/3):
>
> Hi Roland, That's a pity, can you add it as feature request/idea? I think it would help greatly, especially when you have to run query 1,000 times with different filter and&nbsp;multiple joins.&nbsp; I'm doing the loop now, so it's fine, just want to avoid the rage of database admins slight_smile&nbsp; Kind regards, Joseph

> [@Support for parameterized SQL queries and bind parameters in KNIME?](https://forum.knime.com/t/support-for-parameterized-sql-queries-and-bind-parameters-in-knime/87734):
>
> Bind parameters, a.k.a. dynamic parameters or bind variables, provide an alternative way to pass data to the relational database. Instead of putting the values directly into the SQL statement select \* from Foo f where f.baz = 'some string' One can use a placeholder like ?, :name or @name, for example, select \* from Foo f where f.baz = :my\_param and provide the actual values using a separate API call, supported by many common relational database drivers and ORM frameworks (such as, for exampl…

---

<div class="post-metadata">

**Author:** ![zzkary](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/4da419/32.png) [@zzkary](https://forum.knime.com/u/zzkary)\
**Post date:** [April 24, 2026, 3:02am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/3 "2026-04-24T03:02:54Z")

</div>

Hi @takbb

Thank you so much for your detailed and clear explanation! It was extremely helpful. After following your instructions — using `$${squestion_id}$$` instead of `?`, double-clicking the variable name from the Flow Variable List, and clearing the `sql_statement` binding — my DB Query Reader is now working perfectly. I really appreciate your help!

I do have one more follow-up question, if you don’t mind.

**My Use Case: Querying with Multiple question\_ids**

Here’s the scenario:

1. **Every month, I have around 12 new** `question_id` **values** (e.g., 12 IDs for January, 12 different IDs for February, and so on). Each month, I only need to query the data for that specific month’s 12 IDs.

2. My SQL currently looks like this (and it works fine now):

sql

```auto
SELECT
    task_id,
    task_address_id,
    question_id,
    sub_question_id,
    dynamic_circular_title_id,
    dynamic_data_detail_id,
    response_text
FROM
    `newppz_db`.`business_answer`
WHERE
    question_id IN (
        4582759932309995590,
        4582759932309995592,
        4582759932309995594,
        4582759932309995596,
        4582759932309995598,
        4582759932309995600,
        4582759932309995662,
        4582759932309995746,
        4582759932309995806,
        4582759932309995868,
        4582759932309995932,
        4582759932309996004,
        4582759932309996076,
        4582759932309996148
    )
    AND response_text <> ''
    AND deleted = 0

```

**My Questions:**

1. **How should I modify my KNIME workflow and SQL to handle a WHERE condition with multiple question\_ids?** For example, instead of `question_id = $${question_id}$$`, I would need something like:

2. **How would you recommend storing and passing those 12 question\_ids into DB Query Reader?** Should I:

3. **Is there a way to use String Manipulation or a similar node to dynamically build the** `IN (...)` **clause** , so that each month I only need to update the list of IDs and the query adapts automatically?

Thank you again for your time and expertise. Your previous explanation about KNIME using string concatenation rather than true bind variables already gave me a much better understanding of how flow variables work in this context.

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 24, 2026, 8:51am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/4 "2026-04-24T08:51:26Z")

</div>

Glad to hear this helped @zzkary .

For your question of building an IN ( ) list, there are a few options that you can find discussed in the following post from 2022.

> [@DB row Filter with String Widget](https://forum.knime.com/t/db-row-filter-with-string-widget/48080):
>
> Hi All, I have a table which has over 10 million rows. I want to filter on a column which is categorical and i want the user to select multiple categories right at the start of the query. I don’t want the DB Reader node first since that takes in a lot of time. How do i add a list of my choices as a flow variable to my condition in the DB row filter? For example:- My DB Table selector has a custom query select a,b,c,d from xyz; then DB row filter has a condition of b = ‘1234’ set i am conn…

I suggest reading that whole thread through ( as back then I was still learning about this stuff too and my understanding evolved during that thread thanks to @ipazin 😉 ), and also try the workflows that are attached within the posts. I think it should give ideas that cover your question. If anything is unclear, feel free to ask further…

---

<div class="post-metadata">

**Author:** ![fe145f9fb2a1f6b](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/f/f475e1/32.png) [@fe145f9fb2a1f6b](https://forum.knime.com/u/fe145f9fb2a1f6b)\
**Post date:** [April 24, 2026, 9:32am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/5 "2026-04-24T09:32:40Z")

</div>

i would recommend to use the DB Looper instead.  
there you can reference a column (instead of a flow variable) and simply define your statement. this saves you all the trouble of creating a flow variable, proper quoting etc.

```auto
WHERE database_column1 IN (knime_column)

```

additionally, you can tick a box at the bottom to define how large the batches should be (`IN` will work with 1 or more records)

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 24, 2026, 10:46am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/6 "2026-04-24T10:46:34Z")

</div>

Yes indeed, the DB Looping node was given as the solution in the above, but it isn’t always obvious how it should be used especially at first, so hopefully the above post will help, with examples, and give some context.

Another related thread….

> [@db looping](https://forum.knime.com/t/db-looping/74936/2):
>
> Hello @Jeff, DB Looping is a way to go in your case. You just have to get the syntax right. If the table place holder isn’t changed, then it will be replaced with the query from the database input port. So if you connect DB Table Selector node it will take selected table. Yes. Here is screenshot for better understanding: Hope this helps! Br, Ivan

Example workflow on the hub

> **[DB Looping Example – knime](https://hub.knime.com/knime/spaces/Examples/01_Data_Access/02_Databases/24_DB_Looping~IlJ2mnZjT8CcJXWb/current-state)**
>
> This workflow demonstrates the usage of the DB Looping node. The node allows the user to write a SQL query that uses the values from the input table as value l…

---

<div class="post-metadata">

**Author:** ![denisfi](https://forum-cdn.knime.com/user_avatar/forum.knime.com/denisfi/32/83308_2.png) [@denisfi](https://forum.knime.com/u/denisfi)\
**Post date:** [April 24, 2026, 8:22pm UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/7 "2026-04-24T20:22:00Z")

</div>

Hi guys,

I think that you have a loto of posibilities to solve this problem.

Some cases, I use groupby node to concat the information from a column to be just one row. That a way to return less rows and make easy to join large strings from a column to use as parameter/placeholder into your SQL.

A question about those ID are about the will change every month or are the same data. Maybe you can use a regex operation into the sql to join part of the data to make a range or write all 12 inserts at once, Example:

myDate = system.date() / system.now()

date1 = mytage & “01“  
date2 = mytage & “02“  
date31 = mytage & “03“ ….

IDs = date1&”,”&date2&”,”&date3&”,”&…..

and use it inside the Where conditional:

Where

ID like IDs

Just some ideas for this situaation. I didn’t test it yet.

Thanks,

Denis

---

<div class="post-metadata">

**Author:** ![zzkary](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/4da419/32.png) [@zzkary](https://forum.knime.com/u/zzkary)\
**Post date:** [April 27, 2026, 9:34am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/8 "2026-04-27T09:34:41Z")

</div>

Just wanted to drop in and say thanks to all of you who helped me out. Really appreciate it.

I also watched some tutorial videos online, and between your advice and those videos, I managed to throw together a workflow that mostly does what I need.

Still plenty to improve I’m sure, but it’s working for now. Couldn’t have figured it out without you all. Cheers!

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/5/c/5ce0d4c3ed6e3e4175be53e34f85f74180e2ee97.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 4, 2026, 9:34am UTC](https://forum.knime.com/t/how-to-correctly-pass-a-flow-variable-into-db-query-readers-placeholder-error-no-value-specified-for-parameter-1/91845/9 "2026-05-04T09:34:53Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
