finn
February 6, 2021, 4:14pm
1
I am trying to store API json value in SQL db.
DO $$
BEGIN
FOR i in 1..10 LOOP
INSERT INTO tableName (columnName) VALUES ('{ "A": "1", "B": {"C": "2","qty": 3}}');
END LOOP;
END; $$
this syntax works but,
DO $$
BEGIN
FOR i in 1..{{text1.value}} LOOP
INSERT INTO tableName (columnName) VALUES ({{query.data[i]}});
END LOOP;
END; $$
this syntax does not work with the following error
* error:true
* message:"bind message supplies 2 parameters, but prepared statement "" requires 0"
* source:"resource"
i think {{text1.value}}, {{query.data[i]}} is the problem. is there any other way to use it?
justin
February 8, 2021, 3:49pm
2
@finn you might need to disable prepared statements in your DB settings in Retool
rgupta
November 22, 2022, 9:00pm
3
What is the solution that worked here? I am getting the error even though prepared statement checkbox is unchecked for redshift in my retool instance. And it is redshift table as I mentioned
ugo.ago
November 23, 2022, 4:43pm
4
Hello @rgupta ,
In the case @finn , his issue was resolved by disabling prepared statements.
Please could you share the snippet of your failing query?
Here is a cheatsheet that shows how to use the WHERE syntax in redshift