Hi all, I am facing some problem trying to delete rows from a table through command line with vsql. What I did is:
dbadmin@linux-vhcg:~> vsql -Atqc "DELETE FROM myTable WHERE col_1='some_value';"
The console is returned with the number of rows matching the condition, but when I try to do a SELECT, the rows were not deleted... I could do the delete only at the adminTools->connect to database, there if I put in the sql statements, it works. Another observation is that I could do a truncate at command line with vsql:
dbadmin@linux-vhcg:~> vsql -Atqc "TRUNCATE TABLE myTable;"
Above did empty the table.
Hope someone can advise me on how do I get the delete to work. Thanks.
Edit: Using Vertica 7.0.2-1
Edit: (Solved) found the solution in a related post, I should do:
dbadmin@linux-vhcg:~> vsql -Atqc "DELETE FROM myTable WHERE col_1='some_value'; COMMIT;"
Sorry for spamming...
Samuel
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.