I have below code to insert the values into database
db.one('INSERT INTO transactions (transaction_id) VALUES (a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11)')
.then(user => {
console.log(user.name); // print user name;
})
.catch(error => {
console.log(error, 'jjjjjjjjjjjj'); // print the error;
});
I want to insert three fields
1) transaction_id
2) amount
3) currencies_currency_id
But getting error
error: syntax error at or near "c0b"
Please help what I am doing wrong here
INSERT INTO transactions (transaction_id,amount, currencies_currency_id) VALUES ('a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', ?,?)error: syntax error at or near "amount"db.one? it's not part of PostgreSQL. which language is that ? tag that as well. My query should work in PostgreSQL when you substitute other values(?,?)correctly. I don't know how it works in your programming language.