You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE IF NOT EXISTS ${tableName} (
id BIGSERIAL PRIMARY KEY NOT NULL,
value text,
uploaded boolean DEFAULT false
)
I get the data from datalogger like this: "2024-12-20 13:37:23.400",4783.83,5375.243,6897.802,4267.536,4205.374,12072.36,5279.975,7320.997,20.99808,20.53375,-112.3837,-112.5886,-106.6176,-106.4814,-106.4782,-106.6504
I removed the " then use INSERT:
const data = msg.toString().replaceAll("\"", "")
const tableName = datalogger.datalogger_name + '___' + device.Serial
const query = `
INSERT INTO ${tableName}(value)
VALUES('${data}')
`
if(pgClient._connected ){
pgClient.query(query)
.then(() => { console.log('added data to ' + tableName) })
.catch(error => {
console.log('added data to ' + tableName + ' failed: ', error, query)
})
}
Hi, I have table like this:
I get the data from datalogger like this:
"2024-12-20 13:37:23.400",4783.83,5375.243,6897.802,4267.536,4205.374,12072.36,5279.975,7320.997,20.99808,20.53375,-112.3837,-112.5886,-106.6176,-106.4814,-106.4782,-106.6504
I removed the
"
then use INSERT:But I got error:
Can you point me what am I wrong? Thanks
The text was updated successfully, but these errors were encountered: