Strange behavior on SELECT+DROP

Moderator: NorbertKrupa

Post Reply
VerticalMan
Newbie
Newbie
Posts: 8
Joined: Thu Jul 25, 2013 10:47 am

Strange behavior on SELECT+DROP

Post by VerticalMan » Thu Aug 01, 2013 12:16 pm

When I execute a SELECT to my TestTable, output is as expected,

vsql -dX -c "SELECT * FROM TestTable;"

but when I introduce something like:

vsql -dX -c "SELECT * FROM TestTable; DROP TABLE IF EXISTS TestTable;"

Does not show anything and does not throw an error neither

Does anybody know the cause?

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: Strange behavior on SELECT+DROP

Post by id10t » Thu Aug 01, 2013 12:59 pm

Hi!

Option "-c" executes single command only.

Code: Select all

$ vsql --help
...
  -c COMMAND      run only single command (SQL or internal) and exit
Pipe the string into vsql, like this(for executing multiply commands) :

Code: Select all

echo 'SELECT * FROM bar; SELECT * FROM foo;' | vsql

Post Reply

Return to “Vertica Database Development”