INSERT an interger into PostgreSQL using postgrestor node

I can't seem to get the syntax correct for writing an integer into a PostgreSQL table using the postgrestor node getting data from a JSON string.

Here's my query for a string that works fine:

INSERT INTO table2 (field1) VALUES ('{{msg.payload.UnitName}}');

Per the postgrestor help file it seems that for an integer I should just remove the singe quotes, but when I run this:

INSERT INTO table2 (field2) VALUES ({{msg.payload.din1}});

I get this error:
"error: syntax error at or near ")""

Any ideas what the correct syntax might be for working with an integer?

Does din1 actually exist in msg.payload? Use a debug node before& check the payload.

Well... thanks for that suggestion as I found out din1 actually doesn't exist. It's DIN1.
Sheesh, never even thought to check the case.
Bottom line, problem fixed so I'm happy and thanks again!

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