Using Input Field to Populate SQL Query

Hello

I cant seem to figure out what I am doing wrong here.

I have 2 inputs to populate an insert script, when I enter the values in they are showing within the query but they are getting inserted into the DB as @param1 and @param2.

image

Hi @andy2728! Happy to help here. If you hover over @param1 or @param2 in the bottom green preview, does it show the values you expect? And what resource type is this?

Hi @victoria

Yes, Correct the values are there when I hover over the param1 or param2. This is what made me think this would work but when I run the script the DB creates the column values as param1.

The Resource Type is MSSQL.

Thank you for clarifying. It seems to be working for me! Do you have prepared statements disabled in the resource setup page by any chance?

https://docs.retool.com/docs/sql-in-retool#prepared-statements

Hi Victoria,

I had it enabled, I just checked the check box and its working now,

Thanks heaps for you assistance on this it was driving me mad,

Most excellent! The docs should walk through prepared statements (and why we use them and what they restrict), but let me know if you have any questions at all :sunglasses:

Yep just read through all of that now thank you for that.

Thanks again for the prompt support and assistance with this.

As this is my first issue/thread, do I need to close this off somehow?

Of course, my pleasure :blush: Thank you for writing in about this! All users stuck at this same place appreciate you as well :pray:

And nope, nothing you need to do. Write in with a new thread anytime!