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?
Strange behavior on SELECT+DROP
Moderator: NorbertKrupa
Re: Strange behavior on SELECT+DROP
Hi!
Option "-c" executes single command only.
Pipe the string into vsql, like this(for executing multiply commands) :
Option "-c" executes single command only.
Code: Select all
$ vsql --help
...
-c COMMAND run only single command (SQL or internal) and exit
Code: Select all
echo 'SELECT * FROM bar; SELECT * FROM foo;' | vsql