Page 1 of 1

Commit after insert in -c option of vsql

Posted: Fri Dec 13, 2013 5:55 pm
by sam
Hi,

How do I commit an insert that is run from the vsql command line?

Code: Select all

[dbadmin@vertica01 ~]$ vsql -c "select * from jack;"
 one
-----
(0 rows)

[dbadmin@vertica01 ~]$ vsql -c "insert into jack values (1);"
 OUTPUT
--------
      1
(1 row)

[dbadmin@vertica01 ~]$ vsql -c "select * from jack;"
 one
-----
(0 rows)
See the data was not committed? Is there a command line switch for auto commit?

Re: Commit after insert in -c option of vsql

Posted: Fri Dec 13, 2013 6:45 pm
by scutter
vsql -c "insert into jack values (1); commit;”

Re: Commit after insert in -c option of vsql

Posted: Fri Dec 13, 2013 9:11 pm
by id10t
Hi!

[DELETED]

Re: Commit after insert in -c option of vsql

Posted: Fri Dec 13, 2013 9:48 pm
by scutter
Either way works. Neither way is “the right way”.

Re: Commit after insert in -c option of vsql

Posted: Fri Dec 13, 2013 10:07 pm
by sam
Thanks for the quick response scutter and skWa! :D :D :D