QuestDb is not update the db same network and I can access the questdb from n8n but getting this error
Hi @techbrooks, can you try specifying your colum without quotes and parentheses using the format suggested by n8n? So simply usd
if this is the only column you’d like to insert data for?
Same error
Also this the docker image I used for QuestDB
https://github.com/Zapfmeister/questdb_compose
Cheers @techbrooks, I could reproduce this using their official docker image too. I remember successfully using QuestDB for a bit of experimentation in the past without running into this problem and wonder what might have changed. I’ll add this to our bug tracker for a closer look.
As for a workaround, could you try using the Execute Query option in the meantime like so?
This executed fine for me and the row is inserted as expected:
Hey @techbrooks, this seems to be related to your existing database structure. I’d try adding add a second query parameter for your timestamp to satisfy the requirement from your error message.
So a query like INSERT INTO btc (usd, time_stamp) VALUES ($1, $2);
(replace time_stamp
with your actual column name if different) and Query Parameters like usd,time_stamp
.
INSERT INTO btc (usd, time_stamp) VALUES ($1) ; (time_stamp)
No luck and I want the value to be picked up from the SET automatically, may be that is the problem that I am getting the data from coingecok ?
Hey @techbrooks, your query tries to insert two values but uses only one query parameter. You need to specify two parameters ($1, $2)
and then specify the fields from which to read their values in the Query Parameters field (usd,time_stamp
).
So a Query like this:
INSERT INTO btc (usd, time_stamp) VALUES ($1, $2);
And Query Parameters like this:
usd,time_stamp
INSERT INTO btc (usd, time_stamp) VALUES ($1) ; (time_stamp)
Where does the (time_stamp)
at the end come from? I believe QuestDB would try to query that.
Could you try this please:
So a Query like this:
And Query Parameters like this:
OK that seems to work but how will I get the data from the left side update the VALUES? Sorry but I am not strong in DB scripting.
Hey, this should be exactly what this query is doing. When running a query such as INSERT INTO btc (usd, time_stamp) VALUES ($1, $2);
with query parameters of usd
and time_stamp
, n8n would read the usd
and time_stamp
fields of your incoming data and use them in the query.
If you look at the data in your QuestDB you should see the values
Thank you for your help now time t skill up on DB scripting.
No worries, glad to hear this worked and once again sorry for the trouble with the insert operation!