Create SQL Insert Statement from a form input

I have worked it out. Instead of trying to run the INSERT statement for all rows at the same time what needs to happen is you need to call the INSERT (query) from a JS Query and pass each row to the INSERT which will then run the SQL script.

This is because there is some SQL Injection protection enabled in Retool and you don't want to disable it. This means you cannot add variables columns and values to the SQL.

Here is a good explanation on how to trigger the query and pass the row to the INSERT Query

2 Likes