Closed negreanucalin closed 1 year ago
I am indeed new to Vertica but I tried several options to insert data.
One of my latest attempts (from examples):
import * as dotenv from 'dotenv'; dotenv.config(); const {Client} = require('vertica-nodejs') const verticaInsert = () => { const client = new Client() client.connect() client.query("INSERT INTO public.testing (call_id) VALUES (2)", (err: any, res: any) => { console.log(err) console.log(res.rows) client.query("SELECT * FROM public.testing", (err: any, res: any) => { console.log(err || res.rows[0]) client.end() }) }) } verticaInsert();
Output seems okay:
root@d9de246fd6ff:/usr/src/app# ./node_modules/.bin/ts-node src/test_vertics.ts null [ { OUTPUT: 1 } ] { call_id: '100' } // Initial data
Configuration: Node: v14.20.1 Vertica Analytic Database: v12.0.0-0
I can select the data as seen above but the data is inserted, is there something I am missing?
i think you forgot about “COMMIT;”
I am indeed new to Vertica but I tried several options to insert data.
One of my latest attempts (from examples):
Output seems okay:
Configuration: Node: v14.20.1 Vertica Analytic Database: v12.0.0-0
I can select the data as seen above but the data is inserted, is there something I am missing?